Skip to contentSkip to conversation

/sbin/hotplug multiplexor

RFC Arnd Bergmann 2 participants 3 messages Apr 14, 2003

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Oliver Neukum

Well, for a little elegance you might introduce subdirectories for each type of hotplug event and use only them.

I was just about to propose the same. Please use subdirs or namespaced files like in:

for I in "${DIR}/$1".* "${DIR}/"default.* ; do

	test -x $I && $I $1

done

Note that a single event can not only cause one hotplug event for many devices but also _multiple_ events for every device. E.g. enabling a dasd devices will cause hotplug to be called for the local subchannel devices as well as the actual (remote) disk. Maybe someone adds hotplug calls for partitions and logical volumes.
Since dasds are usually not larger than 2GB, you are quite likely to enable many at the same time. Imagine you get 500 disks * 4 events * 10 agents in response to a single user command...

	Arnd <><

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+mzBY5t5GS2LDRf4RAiGEAKCDfJCOqc+IwyzN1cFOOiFKuwqfFwCbBiEe zaWlQP9P0s09DUNoF/xfdLs=
=c6xb
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 11 lines · Arnd Bergmann
Quoted 2 lines · Oliver Neukum

Well, for a little elegance you might introduce subdirectories for each type of hotplug event and use only them.

I was just about to propose the same. Please use subdirs or namespaced files like in:

for I in "${DIR}/$1".* "${DIR}/"default.* ; do

	test -x $I && $I $1

done

Hm, default looks good, but why would it have a .*? How about:

for I in "${DIR}/$1/"* "${DIR}/"default/* ; do

That way the programs that really care about only one subsystem can be easily added, while everyone else can drop into the default directory (which odds are, everyone will want to be in...)

Sound ok?

Quoted 8 lines

Note that a single event can not only cause one hotplug event for many devices but also _multiple_ events for every device. E.g. enabling a dasd devices will cause hotplug to be called for the local subchannel devices as well as the actual (remote) disk. Maybe someone adds hotplug calls for partitions and logical volumes.
Since dasds are usually not larger than 2GB, you are quite likely to enable many at the same time. Imagine you get 500 disks * 4 events * 10 agents in response to a single user command...

Damm, you s390 people, always showing everyone else up :)

Ok, I'll take the '&' out for now, and serialize things within a single hotplug call.

thanks,

greg k-h

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Greg KH

Hm, default looks good, but why would it have a .*? How about:

for I in "${DIR}/$1/"* "${DIR}/"default/* ; do

Whichever you prefer.

Quoted 5 lines

That way the programs that really care about only one subsystem can be easily added, while everyone else can drop into the default directory (which odds are, everyone will want to be in...)

Sound ok?

Yes.

Quoted 2 lines

Ok, I'll take the '&' out for now, and serialize things within a single hotplug call.

Ok, thanks!

	Arnd <><

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+mzTL5t5GS2LDRf4RAq4hAJ98Baat6TlkjsUbDXxXMOPX/5oBbgCghGLm qKRhYYh0Jd+wI963k0XRcZE=
=vo1V
-----END PGP SIGNATURE-----