linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev remove problems
@ 2007-08-25 22:22 Juergen Bausa
  2007-08-25 22:42 ` Kay Sievers
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Juergen Bausa @ 2007-08-25 22:22 UTC (permalink / raw)
  To: linux-hotplug

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 start scripts. The add 
event works fine:

ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
  GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev"

In my first try, I used the following for remove:

ACTION="remove", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000",  \
  RUN+="/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 this on the web 
and tried the following:

ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
  GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev", ENV{toppy}="%p"

ACTION="remove", ENV{toppy}="%p" , RUN+="/usr/local/bin/tf5000pvr_udev"

But it makes no difference: add works fine, but remove doesnt. I used udevmonitor --env 
to see what is happening and found the following:

...

UDEV  [1188080046.847665] remove@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.8_ep00
UDEV_LOG=3
ACTION=remove
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.8_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1132
MAJORD2
MINOR=7
UDEVD_EVENT=1
toppy=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.8_ep00
DEVNAME=/dev/usbdev1.8_ep00

...

So, the variable is saved and found on the remove event, but the script isnt called. What is wrong here? 

Juergen
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc\x100071&distributionid\00000000066


-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev remove problems
  2007-08-25 22:22 udev remove problems Juergen Bausa
@ 2007-08-25 22:42 ` Kay Sievers
  2007-08-26 21:46 ` Juergen Bausa
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-08-25 22:42 UTC (permalink / raw)
  To: linux-hotplug

On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> 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 start scripts. The add
> event works fine:
>
> ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
>   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev"
>
> In my first try, I used the following for remove:
>
> ACTION="remove", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000",  \
>   RUN+="/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 this on the web
> and tried the following:
>
> ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
>   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev", ENV{toppy}="%p"
>
> ACTION="remove", ENV{toppy}="%p" , RUN+="/usr/local/bin/tf5000pvr_udev"

> So, the variable is saved and found on the remove event, but the 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}="?*", or use the
ENV{REMOVE_CMD}="/usr/local ..." which Debian supports. So you don't
need a separate remove rule at all.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev remove problems
  2007-08-25 22:22 udev remove problems Juergen Bausa
  2007-08-25 22:42 ` Kay Sievers
@ 2007-08-26 21:46 ` Juergen Bausa
  2007-08-26 22:10 ` Kay Sievers
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Juergen Bausa @ 2007-08-26 21:46 UTC (permalink / raw)
  To: linux-hotplug


> -----Ursprüngliche Nachricht-----
> Von: "Kay Sievers" <kay.sievers@vrfy.org>
> Gesendet: 26.08.07 00:42:51
> An: "Juergen Bausa" <Juergen.Bausa@web.de>
> CC: linux-hotplug-devel@lists.sourceforge.net
> Betreff: Re: udev remove problems


> 
> On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> 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 start scripts. The add
> > event works fine:
> >
> > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> >   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev"
> >
> > In my first try, I used the following for remove:
> >
> > ACTION="remove", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000",  \
> >   RUN+="/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 this on the web
> > and tried the following:
> >
> > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> >   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev", ENV{toppy}="%p"
> >
> > ACTION="remove", ENV{toppy}="%p" , RUN+="/usr/local/bin/tf5000pvr_udev"
> 
> > So, the variable is saved and found on the remove event, but the 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}="?*", or use the
> ENV{REMOVE_CMD}="/usr/local ..." which Debian supports. So you don't
> need a separate remove rule at all.
> 
> Kay
> 

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, because 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 problem.

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?

Juergen


_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc\x022220


-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev remove problems
  2007-08-25 22:22 udev remove problems Juergen Bausa
  2007-08-25 22:42 ` Kay Sievers
  2007-08-26 21:46 ` Juergen Bausa
@ 2007-08-26 22:10 ` Kay Sievers
  2007-08-28 19:48 ` Juergen Bausa
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-08-26 22:10 UTC (permalink / raw)
  To: linux-hotplug

On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> wrote:
>
> > -----Ursprüngliche Nachricht-----
> > Von: "Kay Sievers" <kay.sievers@vrfy.org>
> > Gesendet: 26.08.07 00:42:51
> > An: "Juergen Bausa" <Juergen.Bausa@web.de>
> > CC: linux-hotplug-devel@lists.sourceforge.net
> > Betreff: Re: udev remove problems
>
>
> >
> > On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> 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 start scripts. The add
> > > event works fine:
> > >
> > > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> > >   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev"
> > >
> > > In my first try, I used the following for remove:
> > >
> > > ACTION="remove", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000",  \
> > >   RUN+="/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 this on the web
> > > and tried the following:
> > >
> > > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> > >   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev", ENV{toppy}="%p"
> > >
> > > ACTION="remove", ENV{toppy}="%p" , RUN+="/usr/local/bin/tf5000pvr_udev"
> >
> > > So, the variable is saved and found on the remove event, but the 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}="?*", or use the
> > ENV{REMOVE_CMD}="/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 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, because 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 problem.
>
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev remove problems
  2007-08-25 22:22 udev remove problems Juergen Bausa
                   ` (2 preceding siblings ...)
  2007-08-26 22:10 ` Kay Sievers
@ 2007-08-28 19:48 ` Juergen Bausa
  2007-08-29  4:26 ` Kay Sievers
  2007-08-29 19:32 ` Juergen Bausa
  5 siblings, 0 replies; 7+ messages in thread
From: Juergen Bausa @ 2007-08-28 19:48 UTC (permalink / raw)
  To: linux-hotplug


> -----Ursprüngliche Nachricht-----
> Von: "Kay Sievers" <kay.sievers@vrfy.org>
> Gesendet: 27.08.07 00:10:33

> 
> On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> wrote:
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: "Kay Sievers" <kay.sievers@vrfy.org>
> > > Gesendet: 26.08.07 00:42:51
> > > An: "Juergen Bausa" <Juergen.Bausa@web.de>
> > >
> > > On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> 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 start scripts. The add
> > > > event works fine:
> > > >

> > >
> > > > So, the variable is saved and found on the remove event, but the 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}="?*", or use the
> > > ENV{REMOVE_CMD}="/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 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, because 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 problem.
> >
> > 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?

Pure userspace

Here is my udev rule:

ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
  GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev" , ENV{REMOVE_CMD}="/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). 
As you can see REMOVE_CMD is set in 4 events, although the rule matches only one time (and in this event 
REMOVE_CMD is not set). And my Script is also started 4 times. 

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­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2
SUBSYSTEM=usb
SEQNUM\x1221
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UEVENT[1188329895.115060] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usbdev1.13_ep00
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usbdev1.13_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1222
MAJORD2
MINOR\x12

UEVENT[1188329895.115119] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0
SUBSYSTEM=usb
SEQNUM\x1223
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/013
PRODUCTK4/6560/9
TYPE=9/0/2
INTERFACE=9/0/1
MODALIAS=usb:v04B4p6560d0009dc09dsc00dp02ic09isc00ip01

UDEV  [1188329895.117488] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2
SUBSYSTEM=usb
SEQNUM\x1221
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1
DRIVER=usb

UDEV  [1188329895.119642] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usbdev1.13_ep00
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/usbdev1.13_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1222
MAJORD2
MINOR\x12
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.13_ep00

UDEV  [1188329895.120830] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0
SUBSYSTEM=usb
SEQNUM\x1223
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/013
PRODUCTK4/6560/9
TYPE=9/0/2
INTERFACE=9/0/1
MODALIAS=usb:v04B4p6560d0009dc09dsc00dp02ic09isc00ip01
UDEVD_EVENT=1

UEVENT[1188329895.222791] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0/usbdev1.13_ep81
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0/usbdev1.13_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1224
MAJORD2
MINOR\x12

UEVENT[1188329895.222885] add@/class/usb_device/usbdev1.13
ACTION­d
DEVPATH=/class/usb_device/usbdev1.13
SUBSYSTEM=usb_device
SEQNUM\x1225
PHYSDEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR\x12

UDEV  [1188329895.224964] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0/usbdev1.13_ep81
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2:1.0/usbdev1.13_ep81
SUBSYSTEM=usb_endpoint
SEQNUM\x1224
MAJORD2
MINOR\x12
UDEVD_EVENT=1
DEVNAME=/dev/usbdev1.13_ep81

UDEV  [1188329895.258281] add@/class/usb_device/usbdev1.13
UDEV_LOG=3
ACTION­d
DEVPATH=/class/usb_device/usbdev1.13
SUBSYSTEM=usb_device
SEQNUM\x1225
PHYSDEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR\x12
UDEVD_EVENT=1
DEVNAME=/dev/bus/usb/001/013

UEVENT[1188329895.528622] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1
SUBSYSTEM=usb
SEQNUM\x1226
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb

UEVENT[1188329895.528916] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.14_ep00
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.14_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1227
MAJORD2
MINOR\x13

UEVENT[1188329895.528960] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0
SUBSYSTEM=usb
SEQNUM\x1228
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/014
PRODUCT\x11db/1000/101
TYPE%5/0/0
INTERFACE%5/0/0
MODALIAS=usb: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­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1.14_ep01
SUBSYSTEM=usb_endpoint
SEQNUM\x1229
MAJORD2
MINOR\x13

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­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1.14_ep82
SUBSYSTEM=usb_endpoint
SEQNUM\x1230
MAJORD2
MINOR\x13

UEVENT[1188329895.529101] add@/class/usb_device/usbdev1.14
ACTION­d
DEVPATH=/class/usb_device/usbdev1.14
SUBSYSTEM=usb_device
SEQNUM\x1231
PHYSDEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR\x13

UDEV  [1188329895.534118] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1
SUBSYSTEM=usb
SEQNUM\x1226
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
UDEVD_EVENT=1
DRIVER=usb

UDEV  [1188329895.550443] add@/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0
UDEV_LOG=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0
SUBSYSTEM=usb
SEQNUM\x1228
PHYSDEVBUS=usb
DEVICE=/proc/bus/usb/001/014
PRODUCT\x11db/1000/101
TYPE%5/0/0
INTERFACE%5/0/0
MODALIAS=usb:v11DBp1000d0101dcFFdsc00dp00icFFisc00ip00
UDEVD_EVENT=1

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=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1.14_ep82
SUBSYSTEM=usb_endpoint
SEQNUM\x1230
MAJORD2
MINOR\x13
UDEVD_EVENT=1
REMOVE_CMD=/usr/local/bin/tf5000pvr_udev
DEVNAME=/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=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/1-2.1:1.0/usbdev1.14_ep01
SUBSYSTEM=usb_endpoint
SEQNUM\x1229
MAJORD2
MINOR\x13
UDEVD_EVENT=1
REMOVE_CMD=/usr/local/bin/tf5000pvr_udev
DEVNAME=/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=3
ACTION­d
DEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1/usbdev1.14_ep00
SUBSYSTEM=usb_endpoint
SEQNUM\x1227
MAJORD2
MINOR\x13
UDEVD_EVENT=1
REMOVE_CMD=/usr/local/bin/tf5000pvr_udev
DEVNAME=/dev/usbdev1.14_ep00

UDEV  [1188329895.688520] add@/class/usb_device/usbdev1.14
UDEV_LOG=3
ACTION­d
DEVPATH=/class/usb_device/usbdev1.14
SUBSYSTEM=usb_device
SEQNUM\x1231
PHYSDEVPATH=/devices/pci0000:00/0000:00:0b.1/usb1/1-2/1-2.1
PHYSDEVBUS=usb
PHYSDEVDRIVER=usb
MAJOR\x189
MINOR\x13
UDEVD_EVENT=1
REMOVE_CMD=/usr/local/bin/tf5000pvr_udev
DEVNAME=/dev/bus/usb/001/014





_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc\x022220


-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev remove problems
  2007-08-25 22:22 udev remove problems Juergen Bausa
                   ` (3 preceding siblings ...)
  2007-08-28 19:48 ` Juergen Bausa
@ 2007-08-29  4:26 ` Kay Sievers
  2007-08-29 19:32 ` Juergen Bausa
  5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2007-08-29  4:26 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2007-08-28 at 21:48 +0200, Juergen Bausa wrote:
> > -----Ursprüngliche Nachricht-----
> > Von: "Kay Sievers" <kay.sievers@vrfy.org>
> > Gesendet: 27.08.07 00:10:33
> 
> > 
> > On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> wrote:
> > >
> > > > -----Ursprüngliche Nachricht-----
> > > > Von: "Kay Sievers" <kay.sievers@vrfy.org>
> > > > Gesendet: 26.08.07 00:42:51
> > > > An: "Juergen Bausa" <Juergen.Bausa@web.de>
> > > >
> > > > On 8/26/07, Juergen Bausa <Juergen.Bausa@web.de> 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 start scripts. The add
> > > > > event works fine:
> > > > >
> 
> > > >
> > > > > So, the variable is saved and found on the remove event, but the 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}="?*", or use the
> > > > ENV{REMOVE_CMD}="/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 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, because 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 problem.
> > >
> > > 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?
> 
> Pure userspace
> 
> Here is my udev rule:
> 
> ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
>   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev" , ENV{REMOVE_CMD}="/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). 
> As you can see REMOVE_CMD is set in 4 events, although the rule matches only one time (and in this event 
> REMOVE_CMD is not set). And my Script is also started 4 times. 
> 
> 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?

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="usb".

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: udev remove problems
  2007-08-25 22:22 udev remove problems Juergen Bausa
                   ` (4 preceding siblings ...)
  2007-08-29  4:26 ` Kay Sievers
@ 2007-08-29 19:32 ` Juergen Bausa
  5 siblings, 0 replies; 7+ messages in thread
From: Juergen Bausa @ 2007-08-29 19:32 UTC (permalink / raw)
  To: linux-hotplug


> -----Ursprüngliche Nachricht-----
> Von: Kay Sievers <kay.sievers@vrfy.org>
> Gesendet: 29.08.07 06:22:06
> An: Juergen Bausa <Juergen.Bausa@web.de>
> CC: linux-hotplug-devel@lists.sourceforge.net
> Betreff: Re: udev remove problems


> > > > > > So, the variable is saved and found on the remove event, but the 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}="?*", or use the
> > > > > ENV{REMOVE_CMD}="/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 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, because 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 problem.
> > > >
> > > > 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?
> > 
> > Pure userspace
> > 
> > Here is my udev rule:
> > 
> > ACTION="add", SYSFS{idVendor}="11db", SYSFS{idProduct}="1000", MODE="0660", \
> >   GROUP="toppy", RUN+="/usr/local/bin/tf5000pvr_udev" , ENV{REMOVE_CMD}="/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). 
> > As you can see REMOVE_CMD is set in 4 events, although the rule matches only one time (and in this event 
> > REMOVE_CMD is not set). And my Script is also started 4 times. 
> > 
> > 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?
> 
> 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="usb".
> 

No luck. I added SUBSYSTEM="usb" and the script is not called anymore. Then I tried PHYSDEVBUS="usb" 
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\x100071&distributionid\00000000066


-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-29 19:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-25 22:22 udev remove problems Juergen Bausa
2007-08-25 22:42 ` Kay Sievers
2007-08-26 21:46 ` Juergen Bausa
2007-08-26 22:10 ` Kay Sievers
2007-08-28 19:48 ` Juergen Bausa
2007-08-29  4:26 ` Kay Sievers
2007-08-29 19:32 ` Juergen Bausa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).