From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kay Sievers" Date: Sun, 26 Aug 2007 22:10:22 +0000 Subject: Re: udev remove problems Message-Id: <3ae72650708261510i5d3a5857x561093f55fec9258@mail.gmail.com> 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 On 8/26/07, Juergen Bausa wrote: > > > -----Urspr=C3=BCngliche 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 > > > > > > 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 fo= r pvr (hard disk recorder) > > > that is connected to my system via usb. Add and remove events should = start scripts. The add > > > event works fine: > > > > > > ACTION=3D"add", SYSFS{idVendor}=3D"11db", SYSFS{idProduct}=3D"1000", = MODE=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 it= s because sysfs > > > values are already gone in case of an remove event. I found a hint on= this on the web > > > and tried the following: > > > > > > ACTION=3D"add", SYSFS{idVendor}=3D"11db", SYSFS{idProduct}=3D"1000", = MODE=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/tf5000p= vr_udev" > > > > > So, the variable is saved and found on the remove event, but the scri= pt isnt called. What is wrong here? > > > > 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. > Thanks. I used REMOVE_CMD and the script is called. But now I have the pr= oblem, that the > remove event appears, when the device is accessed. > > When I plug in, add is called many times (ca. 5). That is no problem, bec= ause my script works > only on the first call. The script creates a desktop icon and starts a da= emon, that allows me to > access my device through a local ftp server. This works without any prob= lem. > > But when I try to login to the ftp server, which triggers actual transfer= to the usb device, the > remove event is run and my remove script is called. > > I have no idea why. Any Hints? Run "udevmonitor" while doing that. What sequence of events does it show? It's a pure userspace solution, or does it need a kernel module? Kay ------------------------------------------------------------------------- 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