linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: register to get notified with hotplug?
Date: Fri, 05 Dec 2003 11:55:23 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107062537312836@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-107062453212116@msgid-missing>

[-- 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

      reply	other threads:[~2003-12-05 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-05 11:41 register to get notified with hotplug? Quynh Nguyen Anh
2003-12-05 11:55 ` Kay Sievers [this message]

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-107062537312836@msgid-missing \
    --to=kay.sievers@vrfy.org \
    --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).