From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer Dorsch Date: Sun, 02 Jan 2005 13:30:37 +0000 Subject: Re: hotplug and test and set Message-Id: <200501021430.37319.rdorsch@web.de> List-Id: References: <200501020003.46376.rdorsch@web.de> In-Reply-To: <200501020003.46376.rdorsch@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Am Sonntag, 2. Januar 2005 02:27 schrieb Marco d'Itri: > On Jan 02, Rainer Dorsch wrote: > > My problem is that this script is called four times when the dongle is > > plugged in. I order to avoid to call pand four times, I added a poor test > > and set to the script to add a lock when a pand is running. Does anybody > > know, what I could do to get a better locking behaviour, e.g. an atomic > > test and set? > > > >From http://linux-hotplug.sourceforge.net/?selected=usb: > > There are two kinds of usb hotplug event: device, and interface. Kernel > 2.6 added device events, as well as reporting the complete set of > interface events. You can tell which kind of event by the environment > variables: device events don't include PRODUCT, or any of the other > parameters here except DEVPATH and ACTION. > > So: > > # ignore device events > [ "$PRODUCT" ] || exit 0 Many thanks for the quick reply. I added (date echo $DEVPATH echo $PRODUCT echo $TYPE echo $ACTION) >> /tmp/epox.log into the script. The result is Sun Jan 2 14:06:32 CET 2005 /devices/pci0000:00/0000:00:07.2/usb1/1-2 add Sun Jan 2 14:06:32 CET 2005 /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0 a12/1/525 224/1/1 add entered locked area Sun Jan 2 14:06:32 CET 2005 /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.1 a12/1/525 224/1/1 add Sun Jan 2 14:06:32 CET 2005 /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.2 a12/1/525 224/1/1 add That means that I should scan for a DEVPATH variable ending with 1.0 (?) Many thanks, Rainer -- Rainer Dorsch Alzentalstr. 28 D-71083 Herrenberg 07032-919495 Icq: 32550367 ------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ 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