linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* register to get notified with hotplug?
@ 2003-12-05 11:41 Quynh Nguyen Anh
  2003-12-05 11:55 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Quynh Nguyen Anh @ 2003-12-05 11:41 UTC (permalink / raw)
  To: linux-hotplug

hello,

i want to write a program that get notified when a usb device (exactly a 
usb memory key) is plugged into the usb port of the machine. i guess 
hotplug fits this job well.

but i dont know how to register my program to hotplug, so it can be 
notified. may you please show me the way? (it is best to have some 
examples or source codes)

thank you and regards,
Nguyen



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: register to get notified with hotplug?
  2003-12-05 11:41 register to get notified with hotplug? Quynh Nguyen Anh
@ 2003-12-05 11:55 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2003-12-05 11:55 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

On Fri, Dec 05, 2003 at 08:41:20PM +0900, Quynh Nguyen Anh wrote:
> hello,
> 
> i want to write a program that get notified when a usb device (exactly a 
> usb memory key) is plugged into the usb port of the machine. i guess 
> hotplug fits this job well.
> 
> but i dont know how to register my program to hotplug, so it can be 
> notified. may you please show me the way? (it is best to have some 
> examples or source codes)

Just put two files into /etc/hotplug/usb/*.
Hotplug will read the *.usermap and if it matches
the USB device it calls given script.
Here is a simple example i use for my DigiCam.

Kay

[-- Attachment #2: canon.usermap --]
[-- Type: text/plain, Size: 186 bytes --]

canon           0x0003      0x04a9     0x3056     0x0000       0x0000       0x00         0x00            0x00            0x00            0x00               0x00               0x00000000

[-- Attachment #3: canon --]
[-- Type: text/plain, Size: 89 bytes --]

#!/bin/sh

/usr/bin/logger -t $0 "found Canon $PRODUCT at $DEVICE"
chown kay:kay $DEVICE

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-05 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-05 11:41 register to get notified with hotplug? Quynh Nguyen Anh
2003-12-05 11:55 ` Kay Sievers

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