auto permissions on udev'd device files?
This is a dupe from SuperUser.com . Folks over there weren't smart enough or willing to help me out; maybe it's more a programmer question than an administrator one:
I have an app that reads input from 4 (four) mice that are plugged in via USB in addition to the built-in touchpad. This is no problem for Ubuntu 9.10: hald notices the new devices and udev's them brand new entries called /dev/input/mouse4
... mouse7
.
My app runs as a normal user app. The files in /dev
belong to root
and aren't readable to anyone else.
I don't have a problem doing chmod a+r mouse?
once, but the devices come and go with every reboot and every time the dang rodents are开发者_运维知识库 plugged in or out.
Can someone please tell me a script or something to manipulate so my chmod
happens automagically?
This information is easily discoverable, I just had to look at /etc/udev/rules.d/91-permissions.rules
on a Debian configuration. :-)
Some interesting examples pasted from there:
# default permissions for block devices
SUBSYSTEM=="block", GROUP="disk"
Looks like there's this "GROUP
" thing to determine the group owner...
And, you can chmod
stuff apparently:
KERNEL=="pty*", MODE="0666", GROUP="tty"
Note the MODE
part...
I'm sure RTFM-ing for the udev config file format will give you even more information. :-)
精彩评论