* [RFC] /sbin/hotplug multiplexor
@ 2003-04-14 19:00 Greg KH
2003-04-14 19:16 ` Oliver Neukum
2003-04-14 22:46 ` [RFC] /sbin/hotplug multiplexor - take 2 Greg KH
0 siblings, 2 replies; 32+ messages in thread
From: Greg KH @ 2003-04-14 19:00 UTC (permalink / raw)
To: linux-hotplug-devel, linux-kernel
Hi all,
With the advent of a lot of people wanting to use /sbin/hotplug to add
their own different types of functions, I want to propose the following
replacement for the current /sbin/hotplug:
-----
#!/bin/sh
DIR="/etc/hotplug.d"
for I in "${DIR}/"* ; do
$I $1 &
done
exit 1
-----
Then all scripts/programs/whatever that wants to get called when
/sbin/hotplug goes off can add themselves to the /etc/hotplug.d
directory.
This should help solve the recent devlabel issue with the current
hotplug scripts, and allow things like udev to also watch all hotplug
actions.
Any objections or comments? If not, I'll make the changes in the
linux-hotplug project and release a new version based on this.
Thanks to Martin Schwenke for giving me this idea (even if he doesn't
realize it :)
Note, this is only for the "big" hotplug versions that live on
everyone's disk. I'm still advocating something small like a
combination of udev and dietHotplug for the initramfs image.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 19:00 [RFC] /sbin/hotplug multiplexor Greg KH @ 2003-04-14 19:16 ` Oliver Neukum 2003-04-14 19:54 ` Greg KH 2003-04-14 22:46 ` [RFC] /sbin/hotplug multiplexor - take 2 Greg KH 1 sibling, 1 reply; 32+ messages in thread From: Oliver Neukum @ 2003-04-14 19:16 UTC (permalink / raw) To: Greg KH, linux-hotplug-devel, linux-kernel > Any objections or comments? If not, I'll make the changes in the > linux-hotplug project and release a new version based on this. Yes, consider what this does if you connect to a FibreChannel grid. You are pushing system load by at least an order of magnitude. Regards Oliver ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 19:16 ` Oliver Neukum @ 2003-04-14 19:54 ` Greg KH 2003-04-14 20:09 ` Oliver Neukum 0 siblings, 1 reply; 32+ messages in thread From: Greg KH @ 2003-04-14 19:54 UTC (permalink / raw) To: oliver; +Cc: linux-hotplug-devel, linux-kernel On Mon, Apr 14, 2003 at 09:16:45PM +0200, Oliver Neukum wrote: > > > Any objections or comments? If not, I'll make the changes in the > > linux-hotplug project and release a new version based on this. > > Yes, consider what this does if you connect to a FibreChannel > grid. You are pushing system load by at least an order of magnitude. When you add a FibreChannel grid, the devices are discovered in sequential order, with SCSI IO happening between each device discovered. In talking to the SCSI people, that should be about 30ms per device found at the quickest. So there's no /sbin/hotplug process storm :) And even if there is, we have to be able to handle such a load under normal situations anyway :) thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 19:54 ` Greg KH @ 2003-04-14 20:09 ` Oliver Neukum 2003-04-14 20:33 ` Greg KH 0 siblings, 1 reply; 32+ messages in thread From: Oliver Neukum @ 2003-04-14 20:09 UTC (permalink / raw) To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel Am Montag, 14. April 2003 21:54 schrieb Greg KH: > On Mon, Apr 14, 2003 at 09:16:45PM +0200, Oliver Neukum wrote: > > > Any objections or comments? If not, I'll make the changes in the > > > linux-hotplug project and release a new version based on this. > > > > Yes, consider what this does if you connect to a FibreChannel > > grid. You are pushing system load by at least an order of magnitude. > > When you add a FibreChannel grid, the devices are discovered in > sequential order, with SCSI IO happening between each device discovered. > In talking to the SCSI people, that should be about 30ms per device > found at the quickest. So there's no /sbin/hotplug process storm :) > > And even if there is, we have to be able to handle such a load under > normal situations anyway :) Well, plugging them in is one case. But what is plugged in, will eventually be unplugged as well. That will not require probing. Now let's be conservative and assume 16KB unswappable memory per task. Now we take the famous 4000 disk case. 64MB. A lot but probably not deadly. But multiply this by 15 and the machine is absolutely dead. Regards Oliver ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 20:09 ` Oliver Neukum @ 2003-04-14 20:33 ` Greg KH 2003-04-14 21:11 ` Oliver Neukum 0 siblings, 1 reply; 32+ messages in thread From: Greg KH @ 2003-04-14 20:33 UTC (permalink / raw) To: oliver; +Cc: linux-hotplug-devel, linux-kernel On Mon, Apr 14, 2003 at 10:09:56PM +0200, Oliver Neukum wrote: > Am Montag, 14. April 2003 21:54 schrieb Greg KH: > > On Mon, Apr 14, 2003 at 09:16:45PM +0200, Oliver Neukum wrote: > > > > Any objections or comments? If not, I'll make the changes in the > > > > linux-hotplug project and release a new version based on this. > > > > > > Yes, consider what this does if you connect to a FibreChannel > > > grid. You are pushing system load by at least an order of magnitude. > > > > When you add a FibreChannel grid, the devices are discovered in > > sequential order, with SCSI IO happening between each device discovered. > > In talking to the SCSI people, that should be about 30ms per device > > found at the quickest. So there's no /sbin/hotplug process storm :) > > > > And even if there is, we have to be able to handle such a load under > > normal situations anyway :) > > Well, plugging them in is one case. But what is plugged in, will > eventually be unplugged as well. That will not require probing. > > Now let's be conservative and assume 16KB unswappable memory > per task. Now we take the famous 4000 disk case. 64MB. A lot > but probably not deadly. But multiply this by 15 and the machine is > absolutely dead. Ok, then the "Enterprise Edition" of the distros that expect to handle 4000 disks will have to add the following patch to their version of the hotplug package. In the meantime, the other 99% of current Linux users will exist just fine :) greg k-h --- hotplug.orig 2003-04-14 13:27:28.513429040 -0700 +++ hotplug 2003-04-14 13:27:40.862551688 -0700 @@ -2,7 +2,7 @@ DIR="/etc/hotplug.d" for I in "${DIR}/"* ; do - $I $1 & + $I $1 done exit 1 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 20:33 ` Greg KH @ 2003-04-14 21:11 ` Oliver Neukum 2003-04-14 21:24 ` Kevin P. Fleming 2003-04-14 21:30 ` Greg KH 0 siblings, 2 replies; 32+ messages in thread From: Oliver Neukum @ 2003-04-14 21:11 UTC (permalink / raw) To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel > > Now let's be conservative and assume 16KB unswappable memory > > per task. Now we take the famous 4000 disk case. 64MB. A lot > > but probably not deadly. But multiply this by 15 and the machine is > > absolutely dead. > > Ok, then the "Enterprise Edition" of the distros that expect to handle > 4000 disks will have to add the following patch to their version of the > hotplug package. > > In the meantime, the other 99% of current Linux users will exist just > fine :) Well, for a little elegance you might introduce subdirectories for each type of hotplug event and use only them. Regards Oliver ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:11 ` Oliver Neukum @ 2003-04-14 21:24 ` Kevin P. Fleming 2003-04-14 21:34 ` Greg KH 2003-04-14 21:45 ` Robert Love 2003-04-14 21:30 ` Greg KH 1 sibling, 2 replies; 32+ messages in thread From: Kevin P. Fleming @ 2003-04-14 21:24 UTC (permalink / raw) To: linux-hotplug-devel; +Cc: linux-kernel Oliver Neukum wrote: >>>Now let's be conservative and assume 16KB unswappable memory >>>per task. Now we take the famous 4000 disk case. 64MB. A lot >>>but probably not deadly. But multiply this by 15 and the machine is >>>absolutely dead. >> >>Ok, then the "Enterprise Edition" of the distros that expect to handle >>4000 disks will have to add the following patch to their version of the >>hotplug package. >> >>In the meantime, the other 99% of current Linux users will exist just >>fine :) > > > Well, for a little elegance you might introduce subdirectories for each type > of hotplug event and use only them. > Personally, this is one reason why I'd much rather see a daemon-based model where each interested daemon can "subscribe" to the messages it is interested in. It's very possible (and likely, i.e. udev) that the steps involved for the daemon to respond to the hotplug event are so lightweight that creating a subprocess to handle them would be very wasteful. Also, this lends itself to multiple levels of messaging: say, for example, userspace partitioning. How would the proposed scheme manage to invoke the userspace partition reading _after_ udev has done its job? If udev itself generated a message into the queue after the device node had been created, the partitioning code could listen for that instead of the native hotplug event. ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:24 ` Kevin P. Fleming @ 2003-04-14 21:34 ` Greg KH 2003-04-14 21:45 ` Robert Love 1 sibling, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-14 21:34 UTC (permalink / raw) To: Kevin P. Fleming; +Cc: linux-hotplug-devel, linux-kernel On Mon, Apr 14, 2003 at 02:24:48PM -0700, Kevin P. Fleming wrote: > > Personally, this is one reason why I'd much rather see a daemon-based model > where each interested daemon can "subscribe" to the messages it is > interested in. It's very possible (and likely, i.e. udev) that the steps > involved for the daemon to respond to the hotplug event are so lightweight > that creating a subprocess to handle them would be very wasteful. One of the hotplug programs will create a D-BUS message that anyone can subscribe to. But I don't want to add that to one of the existing hotplug programs, as it's a separate task. That's one reason for the proposed change. thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:24 ` Kevin P. Fleming 2003-04-14 21:34 ` Greg KH @ 2003-04-14 21:45 ` Robert Love 2003-04-15 18:17 ` Frank van Maarseveen 2003-04-15 19:59 ` David Brownell 1 sibling, 2 replies; 32+ messages in thread From: Robert Love @ 2003-04-14 21:45 UTC (permalink / raw) To: Kevin P. Fleming; +Cc: linux-hotplug-devel, linux-kernel On Mon, 2003-04-14 at 17:24, Kevin P. Fleming wrote: > Personally, this is one reason why I'd much rather see a daemon-based model > where each interested daemon can "subscribe" to the messages it is interested > in. It's very possible (and likely, i.e. udev) that the steps involved for the > daemon to respond to the hotplug event are so lightweight that creating a > subprocess to handle them would be very wasteful. This screams for d-bus. I spent the weekend reading about it and I spoke with some of the d-bus hackers. It is really neat and certainly something we should look into. See http://www.freedesktop.org/software/dbus/ Robert Love ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:45 ` Robert Love @ 2003-04-15 18:17 ` Frank van Maarseveen 2003-04-15 19:59 ` David Brownell 1 sibling, 0 replies; 32+ messages in thread From: Frank van Maarseveen @ 2003-04-15 18:17 UTC (permalink / raw) To: Robert Love; +Cc: linux-kernel On Mon, Apr 14, 2003 at 05:45:54PM -0400, Robert Love wrote: > I spent the weekend reading about it and I spoke with some of the d-bus > hackers. > > It is really neat and certainly something we should look into. > > See http://www.freedesktop.org/software/dbus/ This is way too complicated. It's a message protocol that resembles XDR. The messages are also binary instead of ASCII. Bah. If one would want to subscibe to a small selection of events then the usual filesystem provides a much better concept. For example, a /proc/kernel/event tree. -- Frank ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:45 ` Robert Love 2003-04-15 18:17 ` Frank van Maarseveen @ 2003-04-15 19:59 ` David Brownell 1 sibling, 0 replies; 32+ messages in thread From: David Brownell @ 2003-04-15 19:59 UTC (permalink / raw) To: Robert Love, Kevin P. Fleming; +Cc: linux-hotplug-devel, linux-kernel > On Mon, 2003-04-14 at 17:24, Kevin P. Fleming wrote: >>Personally, this is one reason why I'd much rather see a daemon-based model >>where each interested daemon can "subscribe" to the messages it is interested >>in. It's very possible (and likely, i.e. udev) that the steps involved for the >>daemon to respond to the hotplug event are so lightweight that creating a >>subprocess to handle them would be very wasteful. Historically, one of the motivations for the /sbin/hotplug approach was to avoid the costs of running Yet Another Daemon that's idle almost all the time ... and all it'd do when it learns about a new device is fork an easily-customized shell script, which normally loads driver modules and runs device setup scripts. (Modprobe does per-driver scripts, which are no good for per-device actions, and needs a config file.) Cheaper all around to have the kernel do that; plus, it had information that was not otherwise available to daemons. Much easier to adopt and evolve shell scripts, too. That is, the design center was for medium-weight events that always involve starting new processes, and which moreover tend not to run often. How often do you connect a new USB or PCI device? If it takes a full second to react, that's OK; and Linux is usually faster than that. (Windows isn't! :) I'd certainly agree that some hotplug agents need to be talking with daemons. But I've always thought of them as being application-specific ... tell the print server about a new printer, for example. And what you need to tell that server seems unlikely to be what you'd tell something that's sampling your collection of video or audio streams. Robert Love wrote: > See http://www.freedesktop.org/software/dbus/ Looks interesting. - Dave ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:11 ` Oliver Neukum 2003-04-14 21:24 ` Kevin P. Fleming @ 2003-04-14 21:30 ` Greg KH 2003-04-14 21:43 ` Oliver Neukum 1 sibling, 1 reply; 32+ messages in thread From: Greg KH @ 2003-04-14 21:30 UTC (permalink / raw) To: oliver; +Cc: linux-hotplug-devel, linux-kernel On Mon, Apr 14, 2003 at 11:11:01PM +0200, Oliver Neukum wrote: > > > > Now let's be conservative and assume 16KB unswappable memory > > > per task. Now we take the famous 4000 disk case. 64MB. A lot > > > but probably not deadly. But multiply this by 15 and the machine is > > > absolutely dead. > > > > Ok, then the "Enterprise Edition" of the distros that expect to handle > > 4000 disks will have to add the following patch to their version of the > > hotplug package. > > > > In the meantime, the other 99% of current Linux users will exist just > > fine :) > > Well, for a little elegance you might introduce subdirectories for each type > of hotplug event and use only them. No, that's for the individual scripts/programs to decide. For example, that's what the current hotplug scripts do, but that's not at all what the udev program wants to do. thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:30 ` Greg KH @ 2003-04-14 21:43 ` Oliver Neukum 2003-04-14 21:52 ` Greg KH 0 siblings, 1 reply; 32+ messages in thread From: Oliver Neukum @ 2003-04-14 21:43 UTC (permalink / raw) To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel > > Well, for a little elegance you might introduce subdirectories for each > > type of hotplug event and use only them. > > No, that's for the individual scripts/programs to decide. For example, > that's what the current hotplug scripts do, but that's not at all what > the udev program wants to do. So have them put a symlink into each subdirectory. This is the way it's done for init since times immemorial. Regards Oliver ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:43 ` Oliver Neukum @ 2003-04-14 21:52 ` Greg KH 2003-04-14 22:19 ` Oliver Neukum 0 siblings, 1 reply; 32+ messages in thread From: Greg KH @ 2003-04-14 21:52 UTC (permalink / raw) To: oliver; +Cc: linux-hotplug-devel, linux-kernel On Mon, Apr 14, 2003 at 11:43:17PM +0200, Oliver Neukum wrote: > > > > Well, for a little elegance you might introduce subdirectories for each > > > type of hotplug event and use only them. > > > > No, that's for the individual scripts/programs to decide. For example, > > that's what the current hotplug scripts do, but that's not at all what > > the udev program wants to do. > > So have them put a symlink into each subdirectory. This is the way it's > done for init since times immemorial. But the number of different "types" keeps growing. For some programs (like udev) they really don't care about the type, and if you add a new type, it still works just fine. Other programs do care about the type, so they can look at it and make a judgement based on it. thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 21:52 ` Greg KH @ 2003-04-14 22:19 ` Oliver Neukum 2003-04-14 22:44 ` Greg KH 0 siblings, 1 reply; 32+ messages in thread From: Oliver Neukum @ 2003-04-14 22:19 UTC (permalink / raw) To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel Am Montag, 14. April 2003 23:52 schrieb Greg KH: > On Mon, Apr 14, 2003 at 11:43:17PM +0200, Oliver Neukum wrote: > > > > Well, for a little elegance you might introduce subdirectories for > > > > each type of hotplug event and use only them. > > > > > > No, that's for the individual scripts/programs to decide. For example, > > > that's what the current hotplug scripts do, but that's not at all what > > > the udev program wants to do. > > > > So have them put a symlink into each subdirectory. This is the way it's > > done for init since times immemorial. > > But the number of different "types" keeps growing. For some programs > (like udev) they really don't care about the type, and if you add a new > type, it still works just fine. Other programs do care about the type, > so they can look at it and make a judgement based on it. How can that be? What kind of thing should care about both device addition and routing changes in the same way? Not needlessly exposing scripts to event types they are not written to handle is an advantage. Regards Oliver ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor 2003-04-14 22:19 ` Oliver Neukum @ 2003-04-14 22:44 ` Greg KH 0 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-14 22:44 UTC (permalink / raw) To: oliver; +Cc: linux-hotplug-devel, linux-kernel On Tue, Apr 15, 2003 at 12:19:26AM +0200, Oliver Neukum wrote: > Am Montag, 14. April 2003 23:52 schrieb Greg KH: > > On Mon, Apr 14, 2003 at 11:43:17PM +0200, Oliver Neukum wrote: > > > > > Well, for a little elegance you might introduce subdirectories for > > > > > each type of hotplug event and use only them. > > > > > > > > No, that's for the individual scripts/programs to decide. For example, > > > > that's what the current hotplug scripts do, but that's not at all what > > > > the udev program wants to do. > > > > > > So have them put a symlink into each subdirectory. This is the way it's > > > done for init since times immemorial. > > > > But the number of different "types" keeps growing. For some programs > > (like udev) they really don't care about the type, and if you add a new > > type, it still works just fine. Other programs do care about the type, > > so they can look at it and make a judgement based on it. > > How can that be? What kind of thing should care about both > device addition and routing changes in the same way? No, udev doesn't care about routing changes. But there isn't enough hardcoded logic in it to care about the different subsystems, so it wants to figure out that it shouldn't care about an event all on its own. > Not needlessly exposing scripts to event types they are not written > to handle is an advantage. Ok, I like Arnd's proposal of a "default" directory. Maybe I should change that to "all" as no one better create a subsystem or driver class in the kernel called "all" :) thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 19:00 [RFC] /sbin/hotplug multiplexor Greg KH 2003-04-14 19:16 ` Oliver Neukum @ 2003-04-14 22:46 ` Greg KH 2003-04-15 19:19 ` David Brownell 2003-04-16 6:22 ` Frederic Lepied 1 sibling, 2 replies; 32+ messages in thread From: Greg KH @ 2003-04-14 22:46 UTC (permalink / raw) To: linux-hotplug-devel, linux-kernel Ok, based on the comments so far, how about this proposed version of /sbin/hotplug to provide a multiplexor? thanks, greg k-h ---------- #!/bin/sh DIR="/etc/hotplug.d" for I in "${DIR}/$1/"* "${DIR}/"all/* ; do test -x $I && $I $1 ; done exit 1 ---------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 ` [RFC] /sbin/hotplug multiplexor - take 2 Greg KH @ 2003-04-15 19:19 ` David Brownell 2003-04-16 4:45 ` Greg KH 2003-04-16 6:22 ` Frederic Lepied 1 sibling, 1 reply; 32+ messages in thread From: David Brownell @ 2003-04-15 19:19 UTC (permalink / raw) To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel Greg KH wrote: > Ok, based on the comments so far, how about this proposed version of > /sbin/hotplug to provide a multiplexor? It'd be a reduction in functionality. I could no longer just type "/sbin/hotplug" to see what agents disabled or missing ... or notice that since hotplugging was on, the problem had to be RH9 storing /bin/true into /proc/sys/kernel/hotplug again! :P If the idea is just to loosen today's "one agent per event" rule (I've had that idea too), then wouldn't it be simpler to just (a1) pay an extra process context, not using "exec" to run /etc/hotplug/$1.agent, and when it returns (a2) THEN try other programs? Or even (b) just modify appropriate agent scripts to do so, instead of /sbin/hotplug? I'd think better about this problem if I had a handful of examples showing why category-specific or event-specific dispatch wouldn't be preferable. - Dave > ---------- > #!/bin/sh > DIR="/etc/hotplug.d" > > for I in "${DIR}/$1/"* "${DIR}/"all/* ; do > test -x $I && $I $1 ; > done > > exit 1 > ---------- ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-15 19:19 ` David Brownell @ 2003-04-16 4:45 ` Greg KH 0 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-16 4:45 UTC (permalink / raw) To: David Brownell; +Cc: linux-hotplug-devel, linux-kernel On Tue, Apr 15, 2003 at 12:19:51PM -0700, David Brownell wrote: > Greg KH wrote: > >Ok, based on the comments so far, how about this proposed version of > >/sbin/hotplug to provide a multiplexor? > > It'd be a reduction in functionality. I could no longer just > type "/sbin/hotplug" to see what agents disabled or missing ... > or notice that since hotplugging was on, the problem had to be > RH9 storing /bin/true into /proc/sys/kernel/hotplug again! :P Well you can still do that, the current scripts will get run that way too. > If the idea is just to loosen today's "one agent per event" > rule (I've had that idea too), then wouldn't it be simpler to > just (a1) pay an extra process context, not using "exec" to run > /etc/hotplug/$1.agent, and when it returns (a2) THEN try other > programs? Or even (b) just modify appropriate agent scripts > to do so, instead of /sbin/hotplug? > > I'd think better about this problem if I had a handful of > examples showing why category-specific or event-specific > dispatch wouldn't be preferable. udev is such an example. I want it to run for every hotplug event. To do that with the current scripts, I have to either modify the current scripts to always call it (not a big deal, I have CVS access :) or add a handler for every type of device, and every type of those devices. devlabel is also another type of example. The author of that had to persuade us to modify the scripts in order to get support for his program. I don't want to be a gating function, with this simple proposal, he could just dump the devlabel script into the /etc/hotplug.d directory in the proper place and everything would just work. I've also been hearing from lots of other people (interestingly, not publicly, I guess they like to stay hidden for some reason) that also hook the hotplug scripts. They have usually been either recommending that their users patch the current script, or just replace the current ones all together (thereby loosing the module load functionality) in order to support their devices. This proposal would also help them, and their users. thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 ` [RFC] /sbin/hotplug multiplexor - take 2 Greg KH 2003-04-15 19:19 ` David Brownell @ 2003-04-16 6:22 ` Frederic Lepied 2003-04-18 22:19 ` Greg KH 1 sibling, 1 reply; 32+ messages in thread From: Frederic Lepied @ 2003-04-16 6:22 UTC (permalink / raw) To: Greg KH; +Cc: linux-hotplug-devel, linux-kernel Greg KH <greg@kroah.com> writes: > Ok, based on the comments so far, how about this proposed version of > /sbin/hotplug to provide a multiplexor? I think it would be good to launch only the files ending by a special extension to avoid running backup files. Something like that: #!/bin/sh DIR="/etc/hotplug.d" for I in "${DIR}/$1/"*.hotplug "${DIR}/"all/*.hotplug ; do test -x $I && $I $1 ; done -- Fred - May the source be with you ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-16 6:22 ` Frederic Lepied @ 2003-04-18 22:19 ` Greg KH 0 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-18 22:19 UTC (permalink / raw) To: Frederic Lepied; +Cc: linux-hotplug-devel, linux-kernel On Wed, Apr 16, 2003 at 08:22:13AM +0200, Frederic Lepied wrote: > Greg KH <greg@kroah.com> writes: > > > Ok, based on the comments so far, how about this proposed version of > > /sbin/hotplug to provide a multiplexor? > > I think it would be good to launch only the files ending by a special > extension to avoid running backup files. Something like that: Ah, good idea, will do. thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
* [RFC] /sbin/hotplug multiplexor - take 2
@ 2003-04-14 22:46 Greg KH
2003-04-15 19:19 ` David Brownell
` (7 more replies)
0 siblings, 8 replies; 32+ messages in thread
From: Greg KH @ 2003-04-14 22:46 UTC (permalink / raw)
To: linux-hotplug
Ok, based on the comments so far, how about this proposed version of
/sbin/hotplug to provide a multiplexor?
thanks,
greg k-h
----------
#!/bin/sh
DIR="/etc/hotplug.d"
for I in "${DIR}/$1/"* "${DIR}/"all/* ; do
test -x $I && $I $1 ;
done
exit 1
----------
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH @ 2003-04-15 19:19 ` David Brownell 2003-04-16 0:01 ` Perez-Gonzalez, Inaky ` (6 subsequent siblings) 7 siblings, 0 replies; 32+ messages in thread From: David Brownell @ 2003-04-15 19:19 UTC (permalink / raw) To: linux-hotplug Greg KH wrote: > Ok, based on the comments so far, how about this proposed version of > /sbin/hotplug to provide a multiplexor? It'd be a reduction in functionality. I could no longer just type "/sbin/hotplug" to see what agents disabled or missing ... or notice that since hotplugging was on, the problem had to be RH9 storing /bin/true into /proc/sys/kernel/hotplug again! :P If the idea is just to loosen today's "one agent per event" rule (I've had that idea too), then wouldn't it be simpler to just (a1) pay an extra process context, not using "exec" to run /etc/hotplug/$1.agent, and when it returns (a2) THEN try other programs? Or even (b) just modify appropriate agent scripts to do so, instead of /sbin/hotplug? I'd think better about this problem if I had a handful of examples showing why category-specific or event-specific dispatch wouldn't be preferable. - Dave > ---------- > #!/bin/sh > DIR="/etc/hotplug.d" > > for I in "${DIR}/$1/"* "${DIR}/"all/* ; do > test -x $I && $I $1 ; > done > > exit 1 > ---------- ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* RE: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH 2003-04-15 19:19 ` David Brownell @ 2003-04-16 0:01 ` Perez-Gonzalez, Inaky 2003-04-16 4:45 ` Greg KH ` (5 subsequent siblings) 7 siblings, 0 replies; 32+ messages in thread From: Perez-Gonzalez, Inaky @ 2003-04-16 0:01 UTC (permalink / raw) To: linux-hotplug > From: Greg KH [mailto:greg@kroah.com] > > ... > > for I in "${DIR}/$1/"* "${DIR}/"all/* ; do > test -x $I && $I $1 ; test -x "$I" && "$I" "$1" Just in case? Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own (and my fault) ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH 2003-04-15 19:19 ` David Brownell 2003-04-16 0:01 ` Perez-Gonzalez, Inaky @ 2003-04-16 4:45 ` Greg KH 2003-04-16 6:22 ` Frederic Lepied ` (4 subsequent siblings) 7 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-16 4:45 UTC (permalink / raw) To: linux-hotplug On Tue, Apr 15, 2003 at 12:19:51PM -0700, David Brownell wrote: > Greg KH wrote: > >Ok, based on the comments so far, how about this proposed version of > >/sbin/hotplug to provide a multiplexor? > > It'd be a reduction in functionality. I could no longer just > type "/sbin/hotplug" to see what agents disabled or missing ... > or notice that since hotplugging was on, the problem had to be > RH9 storing /bin/true into /proc/sys/kernel/hotplug again! :P Well you can still do that, the current scripts will get run that way too. > If the idea is just to loosen today's "one agent per event" > rule (I've had that idea too), then wouldn't it be simpler to > just (a1) pay an extra process context, not using "exec" to run > /etc/hotplug/$1.agent, and when it returns (a2) THEN try other > programs? Or even (b) just modify appropriate agent scripts > to do so, instead of /sbin/hotplug? > > I'd think better about this problem if I had a handful of > examples showing why category-specific or event-specific > dispatch wouldn't be preferable. udev is such an example. I want it to run for every hotplug event. To do that with the current scripts, I have to either modify the current scripts to always call it (not a big deal, I have CVS access :) or add a handler for every type of device, and every type of those devices. devlabel is also another type of example. The author of that had to persuade us to modify the scripts in order to get support for his program. I don't want to be a gating function, with this simple proposal, he could just dump the devlabel script into the /etc/hotplug.d directory in the proper place and everything would just work. I've also been hearing from lots of other people (interestingly, not publicly, I guess they like to stay hidden for some reason) that also hook the hotplug scripts. They have usually been either recommending that their users patch the current script, or just replace the current ones all together (thereby loosing the module load functionality) in order to support their devices. This proposal would also help them, and their users. thanks, greg k-h ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH ` (2 preceding siblings ...) 2003-04-16 4:45 ` Greg KH @ 2003-04-16 6:22 ` Frederic Lepied 2003-04-18 22:19 ` Greg KH ` (3 subsequent siblings) 7 siblings, 0 replies; 32+ messages in thread From: Frederic Lepied @ 2003-04-16 6:22 UTC (permalink / raw) To: linux-hotplug Greg KH <greg@kroah.com> writes: > Ok, based on the comments so far, how about this proposed version of > /sbin/hotplug to provide a multiplexor? I think it would be good to launch only the files ending by a special extension to avoid running backup files. Something like that: #!/bin/sh DIR="/etc/hotplug.d" for I in "${DIR}/$1/"*.hotplug "${DIR}/"all/*.hotplug ; do test -x $I && $I $1 ; done -- Fred - May the source be with you ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH ` (3 preceding siblings ...) 2003-04-16 6:22 ` Frederic Lepied @ 2003-04-18 22:19 ` Greg KH 2003-04-18 22:21 ` Greg KH ` (2 subsequent siblings) 7 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-18 22:19 UTC (permalink / raw) To: linux-hotplug On Wed, Apr 16, 2003 at 08:22:13AM +0200, Frederic Lepied wrote: > Greg KH <greg@kroah.com> writes: > > > Ok, based on the comments so far, how about this proposed version of > > /sbin/hotplug to provide a multiplexor? > > I think it would be good to launch only the files ending by a special > extension to avoid running backup files. Something like that: Ah, good idea, will do. thanks, greg k-h ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH ` (4 preceding siblings ...) 2003-04-18 22:19 ` Greg KH @ 2003-04-18 22:21 ` Greg KH 2003-04-19 18:22 ` David Brownell 2003-04-19 18:22 ` David Brownell 7 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-18 22:21 UTC (permalink / raw) To: linux-hotplug On Tue, Apr 15, 2003 at 05:01:40PM -0700, Perez-Gonzalez, Inaky wrote: > > > From: Greg KH [mailto:greg@kroah.com] > > > > ... > > > > for I in "${DIR}/$1/"* "${DIR}/"all/* ; do > > test -x $I && $I $1 ; > > test -x "$I" && "$I" "$1" > > Just in case? Good idea, I've changed it. thanks, greg k-h ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH ` (5 preceding siblings ...) 2003-04-18 22:21 ` Greg KH @ 2003-04-19 18:22 ` David Brownell 2003-04-19 18:22 ` David Brownell 7 siblings, 0 replies; 32+ messages in thread From: David Brownell @ 2003-04-19 18:22 UTC (permalink / raw) To: linux-hotplug Greg KH wrote: > On Tue, Apr 15, 2003 at 12:19:51PM -0700, David Brownell wrote: > >>I'd think better about this problem if I had a handful of >>examples showing why category-specific or event-specific >>dispatch wouldn't be preferable. > > > udev is such an example. I want it to run for every hotplug event. To > do that with the current scripts, I have to either modify the current > scripts to always call it (not a big deal, I have CVS access :) or add a > handler for every type of device, and every type of those devices. I'd go for the "always" call it (if /sys/$DEVPATH/dev exists and udev is enabled). That's category-specific ... but the category is determined by looking at system state, not the event type ($1). > devlabel is also another type of example. The author of that had to > persuade us to modify the scripts in order to get support for his > program. I don't want to be a gating function, with this simple > proposal, he could just dump the devlabel script into the /etc/hotplug.d > directory in the proper place and everything would just work. There's always some kind of gate! (And shouldn't "devlabel" just morph into the "namedev" thing that "udev" wants, so it'd go away soonish"?) I guess there's a different question I see lurking, and that's how "Hotplug NG" starts to develop -- how many things should change, and why. Multiplexing is only one thing to consider, likely more things should be on the table. Including how much to tie to 2.5 capabilities like the new modprobe aliasing, and how to get from here to there. > I've also been hearing from lots of other people (interestingly, not > publicly, I guess they like to stay hidden for some reason) that also > hook the hotplug scripts. They have usually been either recommending > that their users patch the current script, or just replace the current > ones all together (thereby loosing the module load functionality) in > order to support their devices. This proposal would also help them, and > their users. I like the direction of allowing easier extensibility. But I do worry about making it too easy to create chaos. Maybe I worry too much -- the bad mutations should just die out, rather than becoming a cancer that kills. - Dave > thanks, > > greg k-h > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-14 22:46 Greg KH ` (6 preceding siblings ...) 2003-04-19 18:22 ` David Brownell @ 2003-04-19 18:22 ` David Brownell 7 siblings, 0 replies; 32+ messages in thread From: David Brownell @ 2003-04-19 18:22 UTC (permalink / raw) To: linux-hotplug Greg KH wrote: > On Tue, Apr 15, 2003 at 12:19:51PM -0700, David Brownell wrote: > >>I'd think better about this problem if I had a handful of >>examples showing why category-specific or event-specific >>dispatch wouldn't be preferable. > > > udev is such an example. I want it to run for every hotplug event. To > do that with the current scripts, I have to either modify the current > scripts to always call it (not a big deal, I have CVS access :) or add a > handler for every type of device, and every type of those devices. I'd go for the "always" call it (if /sys/$DEVPATH/dev exists and udev is enabled). That's category-specific ... but the category is determined by looking at system state, not the event type ($1). > devlabel is also another type of example. The author of that had to > persuade us to modify the scripts in order to get support for his > program. I don't want to be a gating function, with this simple > proposal, he could just dump the devlabel script into the /etc/hotplug.d > directory in the proper place and everything would just work. There's always some kind of gate! (And shouldn't "devlabel" just morph into the "namedev" thing that "udev" wants, so it'd go away soonish"?) I guess there's a different question I see lurking, and that's how "Hotplug NG" starts to develop -- how many things should change, and why. Multiplexing is only one thing to consider, likely more things should be on the table. Including how much to tie to 2.5 capabilities like the new modprobe aliasing, and how to get from here to there. > I've also been hearing from lots of other people (interestingly, not > publicly, I guess they like to stay hidden for some reason) that also > hook the hotplug scripts. They have usually been either recommending > that their users patch the current script, or just replace the current > ones all together (thereby loosing the module load functionality) in > order to support their devices. This proposal would also help them, and > their users. I like the direction of allowing easier extensibility. But I do worry about making it too easy to create chaos. Maybe I worry too much -- the bad mutations should just die out, rather than becoming a cancer that kills. - Dave > thanks, > > greg k-h > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ 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 ^ permalink raw reply [flat|nested] 32+ messages in thread
* RE: [RFC] /sbin/hotplug multiplexor - take 2
@ 2003-04-16 0:01 Perez-Gonzalez, Inaky
2003-04-18 22:21 ` Greg KH
0 siblings, 1 reply; 32+ messages in thread
From: Perez-Gonzalez, Inaky @ 2003-04-16 0:01 UTC (permalink / raw)
To: 'Greg KH',
'linux-hotplug-devel@lists.sourceforge.net',
'linux-kernel@vger.kernel.org'
> From: Greg KH [mailto:greg@kroah.com]
>
> ...
>
> for I in "${DIR}/$1/"* "${DIR}/"all/* ; do
> test -x $I && $I $1 ;
test -x "$I" && "$I" "$1"
Just in case?
Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)
^ permalink raw reply [flat|nested] 32+ messages in thread* Re: [RFC] /sbin/hotplug multiplexor - take 2 2003-04-16 0:01 Perez-Gonzalez, Inaky @ 2003-04-18 22:21 ` Greg KH 0 siblings, 0 replies; 32+ messages in thread From: Greg KH @ 2003-04-18 22:21 UTC (permalink / raw) To: Perez-Gonzalez, Inaky Cc: 'linux-hotplug-devel@lists.sourceforge.net', 'linux-kernel@vger.kernel.org' On Tue, Apr 15, 2003 at 05:01:40PM -0700, Perez-Gonzalez, Inaky wrote: > > > From: Greg KH [mailto:greg@kroah.com] > > > > ... > > > > for I in "${DIR}/$1/"* "${DIR}/"all/* ; do > > test -x $I && $I $1 ; > > test -x "$I" && "$I" "$1" > > Just in case? Good idea, I've changed it. thanks, greg k-h ^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2003-04-19 18:22 UTC | newest] Thread overview: 32+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2003-04-14 19:00 [RFC] /sbin/hotplug multiplexor Greg KH 2003-04-14 19:16 ` Oliver Neukum 2003-04-14 19:54 ` Greg KH 2003-04-14 20:09 ` Oliver Neukum 2003-04-14 20:33 ` Greg KH 2003-04-14 21:11 ` Oliver Neukum 2003-04-14 21:24 ` Kevin P. Fleming 2003-04-14 21:34 ` Greg KH 2003-04-14 21:45 ` Robert Love 2003-04-15 18:17 ` Frank van Maarseveen 2003-04-15 19:59 ` David Brownell 2003-04-14 21:30 ` Greg KH 2003-04-14 21:43 ` Oliver Neukum 2003-04-14 21:52 ` Greg KH 2003-04-14 22:19 ` Oliver Neukum 2003-04-14 22:44 ` Greg KH 2003-04-14 22:46 ` [RFC] /sbin/hotplug multiplexor - take 2 Greg KH 2003-04-15 19:19 ` David Brownell 2003-04-16 4:45 ` Greg KH 2003-04-16 6:22 ` Frederic Lepied 2003-04-18 22:19 ` Greg KH -- strict thread matches above, loose matches on Subject: below -- 2003-04-14 22:46 Greg KH 2003-04-15 19:19 ` David Brownell 2003-04-16 0:01 ` Perez-Gonzalez, Inaky 2003-04-16 4:45 ` Greg KH 2003-04-16 6:22 ` Frederic Lepied 2003-04-18 22:19 ` Greg KH 2003-04-18 22:21 ` Greg KH 2003-04-19 18:22 ` David Brownell 2003-04-19 18:22 ` David Brownell 2003-04-16 0:01 Perez-Gonzalez, Inaky 2003-04-18 22:21 ` Greg KH
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.