From: Kay Sievers Date: Sat, 29 Jul 2006 11:47:13 +0000 Subject: Re: udev.rules can't set group or mode? Message-Id: <1154173633.3204.70.camel@pim.off.vrfy.org> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Sat, 2006-07-29 at 23:29 +1200, Morgan Read wrote: > Kay Sievers wrote: > > On Fri, 2006-07-28 at 16:25 +1200, Morgan Read wrote: > >> I don't seem to be able to set the mode or group for '/dev/ttyUSB1' > >> > >> Following Daniel Drake's howto here: > >> http://www.reactivated.net/writing_udev_rules.html > >> > >> Without the rule: > >> '/dev/ttyUSB1' has group=3Duucp and mode=0660. > >> > >> With the rule (DRIVER=3D"ark3116", NAME=3D"nokiaca42clone", > >> SYMLINK=3D"ttyUSB%n", GROUP=3D"uucp", MODE=3D"0666"): > >> '/dev/nokiaca42clone' and '/dev/ttyUSB1' (a symlink) get made OK, but > >> with group=3Droot and mode=0600 (not 'uucp' and '0666'). > >> > >> Here's output of udevtest: > >> [morgan@morgansmachine ~]$ udevtest /class/tty/ttyUSB1 > >> main: looking at device '/class/tty/ttyUSB1' from subsystem 'tty' > >> udev_rules_get_name: reset symlink list > >> udev_rules_get_name: add symlink 'ttyUSB1' > >> udev_rules_get_name: rule applied, 'ttyUSB1' becomes 'nokiaca42clone' > >> create_node: creating device node '/dev/nokiaca42clone', major =3D '18= 8', > >> minor =3D '1', mode =3D '0600', uid =3D '0', gid =3D '0' > >> create_node: creating symlink '/dev/ttyUSB1' to 'nokiaca42clone' > >> main: run: 'socket:/org/kernel/udev/monitor' > >> main: run: '/lib/udev/udev_run_devd' > >> main: run: 'socket:/org/freedesktop/hal/udev_event' > >> main: run: '/sbin/pam_console_apply /dev/nokiaca42clone /dev/ttyUSB1 > >=20 > > A similar rule works for me. What version of udev is that? > >=20 > > Why do you rename the device instead of creating just a link? > >=20 > > And better use "+=3D" for symlinks, and '=3D' for compares like DRIVER, > > '"' assignes values. >=20 > Hello Kay, thanks: >=20 > [morgan@morgansmachine ~]$ rpm -q udev > udev-084-13 >=20 > Changed rule to: > DRIVER=3D"ark3116", SYMLINK+=3D"nokiaca42clone", MODE=3D"0666" > (Was following the 0.6 version of > http://www.reactivated.net/writing_udev_rules.html.) Right, that should probably be mentioned, that we don't recommend changing 'default' names, except to make them match the 'default', like moving the input devices in a subdirectory where they have always lived, long before udev. Better create only symlinks, and nothing else will break by making (silly) assumptions about /dev. > Now the device files have the correct group and owner, but mode wont > change? With the new rule mode is 0660? That may be Fedora's pam_console, that comes into your way and changes it back. Look at udevtest again to see what udev is doing. Kay ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel