[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev permissions.rules



Corey Van Allen wrote:
Hello,
I'm stumbling with a udev issue. I need to change the permissions on /
dev/inputs/events*.

I've changed /etc/udev/permissions.rules to
KERNEL="event[0-9]*",   PROGRAM="/etc/udev/scripts/inputdev.sh %k",\
 RESULT="inputdev", MODE="0660", GROUP="users"

but it doesn't seem to respect it.

rebooting still shows
crw-rw----  1 root root 13, 64 2006-03-17 13:09 /dev/input/event0
crw-rw----  1 root root 13, 65 2006-03-17 13:09 /dev/input/event1
crw-rw----  1 root root 13, 66 2006-03-17 13:09 /dev/input/event2
crw-rw----  1 root root 13, 67 2006-03-17 13:09 /dev/input/event3
crw-rw----  1 root root 13, 68 2006-03-17 13:09 /dev/input/event4
crw-rw----  1 root root 13, 69 2006-03-17 13:09 /dev/input/event5
crw-rw----  1 root root 13, 70 2006-03-17 13:09 /dev/input/event6

Even the default /etc/udev/permissions.rules shows
KERNEL="event[0-9]*",   PROGRAM="/etc/udev/scripts/inputdev.sh %k",\
 RESULT="inputdev", MODE="0660", GROUP="video"

yet "video" is not the group for the device.

Suggestions?

Sarge
kernel 2.6.8
udev 0.056-3

The GROUP key in /etc/udev/permissions.rules will only be applied if
"/etc/udev/scripts/inputdev.sh eventX" returns "inputdev". The PROGRAM
and RESULT keys make sure of that. I use Sid, which does not have the
inputdev.sh script anymore, therefore I cannot easily find out what it
does. I have 'SYSFS{name}=="*dvb*|*DVB*|* IR *"' in the corresponding
rule; maybe the script checks for the same thing.

You could try to use a rule without this PROGRAM/RESULT key pair. It is
probably better if you create a separate file for your customizations,
otherwise your changes might get overwritten when udev is upgraded. You
can use something like "/etc/udev/local.rules" and create the symlink
"/etc/udev/rules.d/10_local.rules". The "10_" part makes sure that your
custom rules are applied before all the other ones.

If nevertheless your devices are not created as you specified, it is
probably due to some other rule overriding your definitions. In that
case you can use "udevtest" (I hope it exists in Sarge) to find out
which rules are processed:

$ udevtest /class/input/input0/event0
main: looking at device '/class/input/input0/event0' from subsystem 'input'
udev_rules_get_name: rule applied, 'event0' becomes 'input/event0'
create_node: creating device node '/dev/input/event0', major = '13',
minor = '64', mode = '0660', uid = '0', gid = '0'
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: 'socket:/org/kernel/udev/monitor'
main: run: 'udev_run_hotplugd input'
main: run: 'udev_run_devd input'

This tells me that only the rule from udev.rules is processed, which is
a simple 'KERNEL=="event[0-9]*", NAME="input/%k"' to name the device.
Therefore the device is created with the default owner:group root:root.
(I use Sid, kernel 2.6.15 and udev 0.087-2.)

Regards,
          Florian



Reply to: