From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Bausa Date: Sun, 26 Aug 2007 21:46:22 +0000 Subject: Re: udev remove problems Message-Id: <1535020076@web.de> List-Id: References: <1531272489@web.de> In-Reply-To: <1531272489@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org > -----Urspr=FCngliche Nachricht----- > Von: "Kay Sievers" > Gesendet: 26.08.07 00:42:51 > An: "Juergen Bausa" > CC: linux-hotplug-devel@lists.sourceforge.net > Betreff: Re: udev remove problems >=20 > On 8/26/07, Juergen Bausa wrote: > > udev remove problems > > > > I am using udev 0.105-4 on debian etch. I am trying to setup rules for = pvr (hard disk recorder) > > that is connected to my system via usb. Add and remove events should st= art scripts. The add > > event works fine: > > > > ACTION=3D"add", SYSFS{idVendor}=3D"11db", SYSFS{idProduct}=3D"1000", MO= DE=3D"0660", \ > > GROUP=3D"toppy", RUN+=3D"/usr/local/bin/tf5000pvr_udev" > > > > In my first try, I used the following for remove: > > > > ACTION=3D"remove", SYSFS{idVendor}=3D"11db", SYSFS{idProduct}=3D"1000",= \ > > RUN+=3D"/usr/local/bin/tf5000pvr_udev" > > > > This did not work (in the case of remove nothing happens). I think its = because sysfs > > values are already gone in case of an remove event. I found a hint on t= his on the web > > and tried the following: > > > > ACTION=3D"add", SYSFS{idVendor}=3D"11db", SYSFS{idProduct}=3D"1000", MO= DE=3D"0660", \ > > GROUP=3D"toppy", RUN+=3D"/usr/local/bin/tf5000pvr_udev", ENV{toppy}= =3D"%p" > > > > ACTION=3D"remove", ENV{toppy}=3D"%p" , RUN+=3D"/usr/local/bin/tf5000pvr= _udev" >=20 > > So, the variable is saved and found on the remove event, but the script= isnt called. What is wrong here? >=20 > The string you compare against may not run through the format char > replacement, not sure. Just do ENV{toppy}=3D"?*", or use the > ENV{REMOVE_CMD}=3D"/usr/local ..." which Debian supports. So you don't > need a separate remove rule at all. >=20 > Kay >=20 Thanks. I used REMOVE_CMD and the script is called. But now I have the prob= lem, that the=20 remove event appears, when the device is accessed. When I plug in, add is called many times (ca. 5). That is no problem, becau= se my script works=20 only on the first call. The script creates a desktop icon and starts a daem= on, that allows me to access my device through a local ftp server. This works without any proble= m. But when I try to login to the ftp server, which triggers actual transfer t= o the usb device, the=20 remove event is run and my remove script is called. I have no idea why. Any Hints? Juergen _______________________________________________________________________ Jetzt neu! Sch=FCtzen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ 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