From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Bausa Date: Wed, 29 Aug 2007 19:32:05 +0000 Subject: Re: udev remove problems Message-Id: <1543744704@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: 29.08.07 06:22:06 > An: Juergen Bausa > CC: linux-hotplug-devel@lists.sourceforge.net > Betreff: Re: udev remove problems > > > > > > So, the variable is saved and found on the remove event, but th= e script 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. > > >=20 > > > > Thanks. I used REMOVE_CMD and the script is called. But now I have = the problem, that the > > > > remove event appears, when the device is accessed. > > > > > > > > When I plug in, add is called many times (ca. 5). That is no proble= m, because my script works > > > > only on the first call. The script creates a desktop icon and start= s a daemon, that allows me to > > > > access my device through a local ftp server. This works without an= y problem. > > > > > > > > But when I try to login to the ftp server, which triggers actual tr= ansfer to the usb device, the > > > > remove event is run and my remove script is called. > > > > > > > > I have no idea why. Any Hints? > > >=20 > > > Run "udevmonitor" while doing that. What sequence of events does it s= how? > > >=20 > > > It's a pure userspace solution, or does it need a kernel module? > >=20 > > Pure userspace > >=20 > > Here is my udev rule: > >=20 > > 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{REMOVE_= CMD}=3D"/usr/local/bin/tf5000pvr_udev" > >=20 > > And this is what udevmonitor --env says when I plug in the device (I us= e a very long cable with an usb extender/hub).=20 > > As you can see REMOVE_CMD is set in 4 events, although the rule matches= only one time (and in this event=20 > > REMOVE_CMD is not set). And my Script is also started 4 times.=20 > >=20 > > When I start a connection to the device, I get new add-events. But this= is not in the log (the plug-in log is strange enough). > >=20 > > Whats wrong here? >=20 > Your rule matches all the kernel devices who are created for this usb > device, so this is the correct behavior. You may want to limit the match > by adding SUBSYSTEM=3D"usb". >=20 No luck. I added SUBSYSTEM=3D"usb" and the script is not called anymore. Th= en I tried PHYSDEVBUS=3D"usb"=20 and the script is called multiple times as before. Juergen _____________________________________________________________________ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=000000000066 ------------------------------------------------------------------------- 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