views:

117

answers:

1

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?

+1  A: 

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. :-)

asveikau
Excellent, thank you very much! I dabbled with udev a long time ago but wasn't sure udev was still the mechanism being used, as HAL seems to be all the rage now. And I wasn't sure how they relate. With Linux, once you know where to look the documentation is usually quite good but I needed some help with that first step.
Carl Smotricz
my impression of HAL is that it's a bunch of annoying scripts wrapping the old stuff combined with misuse of Microsoft terminology like "HAL". (y'know, 'cause Redmond has something called HAL, all of us should.) but I can't say I've been following it. :-)
asveikau