Quoting the README: > [1]: Note that read/write access to the /dev/rfkill device is > required and should be provided by the distribution After changing the relevant rule to make /dev/rfkill owned by the plugdev group, I can finally switch on/off my adapter without touching system services or kernel modules with bluetooth-applet.
Should I fix this myself ?
Well, where do you want to fix this? Which ebuild does create group plugdev? Until now sys-fs/udev provided rules only know these groups: audio cdrom disk floppy kmem lp tape tty usb uucp video This is almost like upstream, but gentoo adds group usb for /dev/bus/usb/* and renamed dialout to uucp. So if we can be sure group plugdev will exist or udev does no harm in this case, I suggest adding it to 40-gentoo.rules
Created attachment 233877 [details] 40-rfkill.rules Adding this just for the record. I've added the attached file to /etc/udev/rules.d/, reloaded rules and ran udevadm trigger and it made the problem go away.
After adding 40-rfkill.rules to /etc/udev/rules.d/ and restarting udev (/etc/init.d/udev restart) I have now the following permissions of /dev/rfkill: root@lynx:/root(8)# ll /dev/rfkill crw-r--r-- 1 root plugdev 10, 57 Jun 8 10:55 /dev/rfkill I.e. it s not writable by plugdev.
And also after reboot I find in .xsession-errors: ... (gnome-settings-daemon:7941): GLib-GObject-CRITICAL **: g_param_spec_flags: assertion `G_TYPE_IS_FLAGS (flags_type)' failed (gnome-settings-daemon:7941): GLib-GObject-CRITICAL **: g_object_class_install_property: assertion `G_IS_PARAM_SPEC (pspec)' failed ** (bluetooth-applet:8328): WARNING **: Could not open RFKILL control device, please verify your installation (polkit-gnome-authentication-agent-1:8346): GLib-GObject-WARNING **: cannot register existing type `_PolkitError' (polkit-gnome-authentication-agent-1:8346): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
I suppose the reason is that /dev/rfkill does not have the permissions as expected from /etc/udev/rules.d/40-rfkill.rules: root@lynx:/root(6)# grep rfkill /etc/udev/rules.d/40-rfkill.rules KERNEL=="rfkill", GROUP="plugdev", MODE="0664" but: root@lynx:/root(8)# ls -l /dev/rfkill | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf("%0o ",k);print}' 644 crw-r--r-- 1 root plugdev 10, 57 Jun 8 11:19 /dev/rfkill
And I beling to plugdev group: rose@lynx:/home/rose(1)$ id uid=1203(rose) gid=1000(rose) Gruppen=1000(rose),4(adm),6(disk),7(lp),10(wheel),14(uucp),18(audio),19(cdrom),27(video),35(games),100(users),250(portage),1004(plugdev),1010(vboxusers),1013(wireshark),1016(qemu),1020(kvm),1212(nwaccess),1217(tuntap)
If I switch on udev debugging and monitoring in /etc/conf.d/udev: udev_debug="YES" udev_monitor="YES" I find in /dev/.udev/udev.log the lines: ... 1276007135.547856 [1167] udev_device_new_from_syspath: device 0x2338690 has devpath '/devices/virtual/misc/rfkill' 1276007135.547927 [1167] udev_rules_apply_to_event: GROUP 1004 /etc/udev/rules.d/40-rfkill.rules:4 1276007135.547932 [1167] udev_rules_apply_to_event: MODE 0664 /etc/udev/rules.d/40-rfkill.rules:4 1276007135.547953 [1167] udev_rules_apply_to_event: LINK 'char/10:57' /lib64/udev/rules.d/50-udev-default.rules:4 1276007135.547966 [1167] udev_rules_apply_to_event: MODE 0644 /lib64/udev/rules.d/50-udev-default.rules:104 1276007135.547986 [1167] udev_rules_apply_to_event: RUN 'socket:@/org/freedesktop/hal/udev_event' /etc/udev/rules.d/90-hal.rules:2 1276007135.547997 [1167] udev_event_execute_rules: no node name set, will use kernel supplied name 'rfkill' 1276007135.548033 [1167] udev_device_update_db: created db link (rfkill char/10:57) 1276007135.548042 [1167] udev_node_add: creating device node '/dev/rfkill', devnum=10:57, mode=0644, uid=0, gid=1004 1276007135.548049 [1167] udev_node_mknod: preserve file '/dev/rfkill', because it has correct dev_t 1276007135.548055 [1167] udev_node_mknod: set permissions /dev/rfkill, 020644, uid=0, gid=1004 1276007135.548071 [1167] node_symlink: creating symlink '/dev/char/10:57' to '../rfkill' ... If I understand this correctly, udev gets the information from /etc/udev/rules.d/40-rfkill.rules to create a device node with mode 0664 and from /lib64/udev/rules.d/50-udev-default.rules to create the node mith mode 0644. In /lib64/udev/rules.d/50-udev-default.rules I find the line: root@moose:/root(5)# grep rfkill /lib64/udev/rules.d/50-udev-default.rules KERNEL=="rfkill", MODE="0644" What should I do, remove this line from 50-udev-default.rules, change the number 40-rfkill.rules name into a higher number, or...?
+ 16 Dec 2010; Gilles Dartiguelongue <eva@gentoo.org> +files/80-rfkill.rules, + gnome-bluetooth-2.32.0.ebuild: + Add udev rules in order to get rfkill control, bug #315351. ok, I decided to make gnome-bluetooth handle this stuff as most other packages to have to control specific devices (sane-backends, libgphoto2, ...). Feel free to stab me if the rules are wrong or whatever. Thanks for your help in this bug.