My problemI have the following lines in /etc/devd.conf which execute the usbhidaction for a /dev/uhid* device with the named vendor and product id.attach 100 {    match vendor  0x046a;    match product 0x0107;    action /usr/local/bin/sudo -u my_user /usr/bin/usbhidaction -f $device-name -p /var/hid_run/usbaction.pid -c /etc/hidactions/cherry_JK0200;};and the following lines in /etc/devfs.rules[tant=10]add path 'uhid*' mode 0660 group hidBut when I reboot the devd part is executed before the devfs part and then my_user has no permissions to read from /dev/uhid*.Now why is devfs slower then devd, and what can I do to fix this?Is there another way to configure the devfs?Why I do thisI bought a new keyboard and the function keys are an additional usb-hid device.Now I wanted to execute small scripts when I press one of these function keys, like decrease volume or mute volume.Since the scripts are from the my_user I don't want the programs be executed by root. Especially not something like a calculator or a shell.
Why are devd rules applied before devfs rules?
freebsd;devices
Devd runs BEFORE rc and therefore before devfs - this was carefully chosen by its creator - you can see his reasoning here: http://www.usenix.org/events/bsdcon03/tech/full_papers/losh/losh.pdf (Chapt. 7.2)Devd runs entirely in user space, there is no issue with root privileges. Unless you choose to sudo - which is what you did.Use devd.conf to set a value in user space. Test for your flag in devfs.