linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: martin f krafft <madduck@madduck.net>
To: linux-hotplug@vger.kernel.org
Subject: /etc/hotplug or /etc/hotplug.d ?
Date: Sat, 12 Feb 2005 16:35:24 +0000	[thread overview]
Message-ID: <20050212163524.GA21962@albatross.madduck.net> (raw)

[-- 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 --]

             reply	other threads:[~2005-02-12 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-12 16:35 martin f krafft [this message]
2005-02-15  7:31 ` /etc/hotplug or /etc/hotplug.d ? Greg KH
2005-02-15  9:48 ` martin f krafft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050212163524.GA21962@albatross.madduck.net \
    --to=madduck@madduck.net \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).