From: Stephen Williams <steve@icarus.com>
To: linux-hotplug@vger.kernel.org
Subject: Hot*un*plug
Date: Mon, 21 May 2001 01:34:02 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-99040891900997@msgid-missing> (raw)
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
reply other threads:[~2001-05-21 1:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=marc-linux-hotplug-99040891900997@msgid-missing \
--to=steve@icarus.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).