From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: /etc/hotplug or /etc/hotplug.d ?
Date: Tue, 15 Feb 2005 07:31:39 +0000 [thread overview]
Message-ID: <20050215073139.GA21766@kroah.com> (raw)
In-Reply-To: <20050212163524.GA21962@albatross.madduck.net>
On Sat, Feb 12, 2005 at 05:35:24PM +0100, martin f krafft wrote:
> 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.
Who said to do it that way?
> 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.
True. But a simple check at the start of your script/program will
handle that properly, right?
> /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.
True, stay away from this, people are working to get rid of the
/etc/hotplug/ scripts :)
> What's your opinion? Which hook should I prefer?
Again, what's the problem with using /etc/hotplug.d/ ?
thanks,
greg k-h
-------------------------------------------------------
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_ide95&alloc_id\x14396&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
next prev parent reply other threads:[~2005-02-15 7:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-12 16:35 /etc/hotplug or /etc/hotplug.d ? martin f krafft
2005-02-15 7:31 ` Greg KH [this message]
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=20050215073139.GA21766@kroah.com \
--to=greg@kroah.com \
--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).