From mboxrd@z Thu Jan 1 00:00:00 1970 From: martin f krafft Date: Sat, 12 Feb 2005 16:35:24 +0000 Subject: /etc/hotplug or /etc/hotplug.d ? Message-Id: <20050212163524.GA21962@albatross.madduck.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" List-Id: To: linux-hotplug@vger.kernel.org --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, I develop the user-space driver for a USB device (libphidgets). To be able to make it as easy as possible to my users, I want to register a hotplug hook that chmod's the /proc/bus/usb/*/* file to 0660:root:phidgets upon connection, so that (only) members of the phidgets group can use it. There seem to be two approaches. At first, I was using a simple script in /etc/hotplug/usb: http://cvs.ailab.ch/cgi-bin/viewcvs.cgi/external/libphidgets/hotplug/Atti= c/phidgets?rev=3D1.2&view=3Dauto along with a user map entry to have the script called upon insertion of a USB device with a certain ID pair: http://cvs.ailab.ch/cgi-bin/viewcvs.cgi/external/libphidgets/hotplug/Atti= c/phidgets.usermap?rev=3D1.2&view=3Dauto Greg KH suggested to me not to bother with the usermaps and instead provide a script in /etc/hotplug.d/usb instead. So I did: http://cvs.ailab.ch/cgi-bin/viewcvs.cgi/external/libphidgets/hotplug/phid= gets.hotplug?rev=3D1.3&view=3Dauto Both approaches work. However, now I am being told that it is "better" to use /etc/hotplug (like I did in the first approach). I was unable to squeeze any real arguments out of the person asserting this. But it got me thinking, so I want to find the real answer now. Using /etc/hotplug.d/usb seems to have the advantage that it does not need the usermap, but it's called for every USB device ever inserted. /etc/hotplug/usb is only called if the usermap line matches. It requires the line to specify a script to be called. However, scripts are also called upon loading of a module by the same name by hotplug, so there is a potential source of conflict. What's your opinion? Which hook should I prefer? Thanks, --=20 martin; (greetings from the heart of the sun.) \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck =20 invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver! spamtraps: madduck.bogus@madduck.net =20 "zwei monologe, die sich gegenseitig immer und immer wieder st=F6rend unterbrechen, nennt man eine diskussion." -- charles tschopp --MGYHOYXEY6WxJCY8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCDjBMIgvIgzMMSnURAgyBAKCKx6n1w4T2OlHgHFUGXLIBvocDcQCeOC2/ IuPSmUFx2aO2+cIK2AsWk/M= =HK/l -----END PGP SIGNATURE----- --MGYHOYXEY6WxJCY8-- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ 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