From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juergen Bausa Date: Tue, 28 Aug 2007 19:48:15 +0000 Subject: Re: udev remove problems Message-Id: <1540969704@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: 27.08.07 00:10:33 >=20 > On 8/26/07, Juergen Bausa wrote: > > > > > -----Urspr=FCngliche Nachricht----- > > > Von: "Kay Sievers" > > > Gesendet: 26.08.07 00:42:51 > > > An: "Juergen Bausa" > > > > > > 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 shoul= d start scripts. The add > > > > event works fine: > > > > > > > > > > > So, the variable is saved and found on the remove event, but the sc= ript 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 problem, b= ecause my script works > > only on the first call. The script creates a desktop icon and starts a = daemon, that allows me to > > access my device through a local ftp server. This works without any pr= oblem. > > > > But when I try to login to the ftp server, which triggers actual transf= er 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 show? >=20 > It's a pure userspace solution, or does it need a kernel module? Pure userspace Here is my udev rule: 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{REMOVE_CMD}= =3D"/usr/local/bin/tf5000pvr_udev" And this is what udevmonitor --env says when I plug in the device (I use 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 onl= y one time (and in this event=20 REMOVE_CMD is not set). And my Script is also started 4 times.=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). Whats wrong here? Juergen lisa:/home/jba# udevmonitor --env udevmonitor prints the received event from the kernel [UEVENT] and the event which udev sends out after rule processing [UDEV] UEVENT[1188329895.114897] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2 SUBSYSTEM=3Dusb SEQNUM=1221 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb UEVENT[1188329895.115060] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usb= dev1.13_ep00 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usbdev1.13_ep00 SUBSYSTEM=3Dusb_endpoint SEQNUM=1222 MAJORD2 MINOR=12 UEVENT[1188329895.115119] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= :1.0 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0 SUBSYSTEM=3Dusb SEQNUM=1223 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/013 PRODUCTK4/6560/9 TYPE=3D9/0/2 INTERFACE=3D9/0/1 MODALIAS=3Dusb:v04B4p6560d0009dc09dsc00dp02ic09isc00ip01 UDEV [1188329895.117488] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2 SUBSYSTEM=3Dusb SEQNUM=1221 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb UDEVD_EVENT=3D1 DRIVER=3Dusb UDEV [1188329895.119642] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usb= dev1.13_ep00 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usbdev1.13_ep00 SUBSYSTEM=3Dusb_endpoint SEQNUM=1222 MAJORD2 MINOR=12 UDEVD_EVENT=3D1 DEVNAME=3D/dev/usbdev1.13_ep00 UDEV [1188329895.120830] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= :1.0 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0 SUBSYSTEM=3Dusb SEQNUM=1223 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/013 PRODUCTK4/6560/9 TYPE=3D9/0/2 INTERFACE=3D9/0/1 MODALIAS=3Dusb:v04B4p6560d0009dc09dsc00dp02ic09isc00ip01 UDEVD_EVENT=3D1 UEVENT[1188329895.222791] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= :1.0/usbdev1.13_ep81 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0/usbdev1.13_ep81 SUBSYSTEM=3Dusb_endpoint SEQNUM=1224 MAJORD2 MINOR=12 UEVENT[1188329895.222885] add@/class/usb_device/usbdev1.13 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.13 SUBSYSTEM=3Dusb_device SEQNUM=1225 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=12 UDEV [1188329895.224964] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= :1.0/usbdev1.13_ep81 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0/usbdev1.13_ep81 SUBSYSTEM=3Dusb_endpoint SEQNUM=1224 MAJORD2 MINOR=12 UDEVD_EVENT=3D1 DEVNAME=3D/dev/usbdev1.13_ep81 UDEV [1188329895.258281] add@/class/usb_device/usbdev1.13 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.13 SUBSYSTEM=3Dusb_device SEQNUM=1225 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=12 UDEVD_EVENT=3D1 DEVNAME=3D/dev/bus/usb/001/013 UEVENT[1188329895.528622] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1 SUBSYSTEM=3Dusb SEQNUM=1226 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb UEVENT[1188329895.528916] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/usbdev1.14_ep00 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.14_ep00 SUBSYSTEM=3Dusb_endpoint SEQNUM=1227 MAJORD2 MINOR=13 UEVENT[1188329895.528960] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/1-2.1:1.0 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0 SUBSYSTEM=3Dusb SEQNUM=1228 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/014 PRODUCT=11db/1000/101 TYPE%5/0/0 INTERFACE%5/0/0 MODALIAS=3Dusb:v11DBp1000d0101dcFFdsc00dp00icFFisc00ip00 UEVENT[1188329895.529012] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/1-2.1:1.0/usbdev1.14_ep01 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1= .14_ep01 SUBSYSTEM=3Dusb_endpoint SEQNUM=1229 MAJORD2 MINOR=13 UEVENT[1188329895.529050] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/1-2.1:1.0/usbdev1.14_ep82 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1= .14_ep82 SUBSYSTEM=3Dusb_endpoint SEQNUM=1230 MAJORD2 MINOR=13 UEVENT[1188329895.529101] add@/class/usb_device/usbdev1.14 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.14 SUBSYSTEM=3Dusb_device SEQNUM=1231 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=13 UDEV [1188329895.534118] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1 SUBSYSTEM=3Dusb SEQNUM=1226 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb UDEVD_EVENT=3D1 DRIVER=3Dusb UDEV [1188329895.550443] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/1-2.1:1.0 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0 SUBSYSTEM=3Dusb SEQNUM=1228 PHYSDEVBUS=3Dusb DEVICE=3D/proc/bus/usb/001/014 PRODUCT=11db/1000/101 TYPE%5/0/0 INTERFACE%5/0/0 MODALIAS=3Dusb:v11DBp1000d0101dcFFdsc00dp00icFFisc00ip00 UDEVD_EVENT=3D1 UDEV [1188329895.604968] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/1-2.1:1.0/usbdev1.14_ep82 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1= .14_ep82 SUBSYSTEM=3Dusb_endpoint SEQNUM=1230 MAJORD2 MINOR=13 UDEVD_EVENT=3D1 REMOVE_CMD=3D/usr/local/bin/tf5000pvr_udev DEVNAME=3D/dev/usbdev1.14_ep82 UDEV [1188329895.628229] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/1-2.1:1.0/usbdev1.14_ep01 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1= .14_ep01 SUBSYSTEM=3Dusb_endpoint SEQNUM=1229 MAJORD2 MINOR=13 UDEVD_EVENT=3D1 REMOVE_CMD=3D/usr/local/bin/tf5000pvr_udev DEVNAME=3D/dev/usbdev1.14_ep01 UDEV [1188329895.635222] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2= .1/usbdev1.14_ep00 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.14_ep00 SUBSYSTEM=3Dusb_endpoint SEQNUM=1227 MAJORD2 MINOR=13 UDEVD_EVENT=3D1 REMOVE_CMD=3D/usr/local/bin/tf5000pvr_udev DEVNAME=3D/dev/usbdev1.14_ep00 UDEV [1188329895.688520] add@/class/usb_device/usbdev1.14 UDEV_LOG=3D3 ACTION=ADd DEVPATH=3D/class/usb_device/usbdev1.14 SUBSYSTEM=3Dusb_device SEQNUM=1231 PHYSDEVPATH=3D/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1 PHYSDEVBUS=3Dusb PHYSDEVDRIVER=3Dusb MAJOR=189 MINOR=13 UDEVD_EVENT=3D1 REMOVE_CMD=3D/usr/local/bin/tf5000pvr_udev DEVNAME=3D/dev/bus/usb/001/014 _______________________________________________________________________ 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