linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* /etc/hotplug or /etc/hotplug.d ?
@ 2005-02-12 16:35 martin f krafft
  2005-02-15  7:31 ` Greg KH
  2005-02-15  9:48 ` martin f krafft
  0 siblings, 2 replies; 3+ messages in thread
From: martin f krafft @ 2005-02-12 16:35 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

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/Attic/phidgets?rev=1.2&view=auto

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/Attic/phidgets.usermap?rev=1.2&view=auto

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/phidgets.hotplug?rev=1.3&view=auto

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,

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
invalid/expired pgp subkeys? use subkeys.pgp.net as keyserver!
spamtraps: madduck.bogus@madduck.net
 
"zwei monologe, die sich gegenseitig
 immer und immer wieder störend unterbrechen,
 nennt man eine diskussion."
                                                    -- charles tschopp

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-02-15  9:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-12 16:35 /etc/hotplug or /etc/hotplug.d ? martin f krafft
2005-02-15  7:31 ` Greg KH
2005-02-15  9:48 ` martin f krafft

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).