When I am trying to start cdemu-daemon, I see the following error message.
Starting CDEmu daemon with following parameters:
- num devices: 1
- control device: /dev/vhba_ctl
- audio driver: null
- bus type: session
cdemu0: Kernel I/O: failed to open control device /dev/vhba_ctl: Permission denied!
cdemu: Daemon: failed to start device #0!
cdemu: Daemon: failed to create device!
Daemon initialization and start failed!
Indeed I don't have permissions to this device file.
Size: 0 Blocks: 0 IO Block: 4096 character special file
Device: 6h/6d Inode: 19713 Links: 1 Device type: a,39
Access: (0600/crw-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2019-03-17 09:30:11.576666732 +0000
Modify: 2019-03-17 09:30:11.576666732 +0000
Change: 2019-03-17 09:30:11.576666732 +0000
Udev rule is the following:
# do not edit this file, it will be overwritten on update
KERNEL=="vhba_ctl", SUBSYSTEM=="misc", TAG+="uaccess"
How does it suppose to work? I thought I may have to add my user to the special group, but file is accessible for root only.
udev-239, vhba tried 20170610 and 20190302.
$ getfacl /dev/vhba*
getfacl: Removing leading '/' from absolute path names
# file: dev/vhba_ctl
# owner: root
# group: root
$ udevadm info /dev/vhba_ctl
I guess it's logind taking care of enabling access to currently logged in user. Don't know if there are non-logind ways to get it working out of the box.
The udev rules needs to be changed to the following:
KERNEL=="vhba_ctl", SUBSYSTEM=="misc", TAG+="uaccess", TAG+="udev-acl"
TAG+="uaccess" is for logind while TAG+="udev-acl" is for ConsoleKit. Tested and working for me.
Non logind/ConsoleKit systems can create /etc/udev/rules.d/69-vhba.rules with the following:
KERNEL=="vhba_ctl", SUBSYSTEM=="misc", MODE="0660", GROUP="cdrom"
and add their user to the cdrom group.
Does it mean that I have to install elogind package (and start daemon) to make it work?.. Why not to add this as a dependency?
The current udev rule only works when logind is available. You can install elogind but that is overkill if you don't need it for anything else. It's much simpler to add the rule from comment #3 and add your user to the cdrom group.
logind is not a dependency because it's not required for cdemu to function. The udev rule is provided by the package maintainer as a courtesy to the user. Unfortunately it currently doesn't work for all users.