linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Hot*un*plug
@ 2001-05-21  1:34 Stephen Williams
  0 siblings, 0 replies; only message in thread
From: Stephen Williams @ 2001-05-21  1:34 UTC (permalink / raw)
  To: linux-hotplug


It looks like the hotplug remove action is not supported by usb.agent
or pci.agent. OK Fine, I get to wonder now how to implement it.

Basically, I have a hotplug add action that is called (by usb.agent)
when a device appears. It creates a symbolic link is /var/run to the
/proc/bus/usb/... file that is the device. Works fine.

I need some hook to *remove* that link. I've considered a couple
possibilities:

	1) Make my add action stick around as a demon, and poll
	the device. When the device disappears, remove the link
	and exit.

	2) Modify the usb.agent to call a configured program when
	the hotplug remove happens. This program will remove the link
	when it is executed.

	3) Have my add program register with the hotplug scripts
	to watch the device for me. The add demon would write a
	little script into a magic file when it executes, and the
	usb.agent would be modified to look for this file when the
	remove event is executed.

I personally like #3. I can write the file ``proc%bus%usb%004%002''
in /var/run/hotplug with a program or link that usb.agent can
execute when it detects a remove. It can automatically remove the
file after executing it.

The advantage here is that it doesn't burden the system when the
remove event doesn't matter for a device, the lookup should be very
fast, and work for usb and pci, and it doesn't cost a demon polling
for the device.

Comments?
-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."



_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-21  1:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-21  1:34 Hot*un*plug Stephen Williams

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).