Re: [systemd-devel] udev event on usb unpluged

2015-08-31 Thread christophe . jalady
hristophe jalady" Cc: "Robert Milasan" , "systemd" Envoyé: Dimanche 30 Août 2015 05:13:08 Objet: Re: [systemd-devel] udev event on usb unpluged First of all I meant "Are you sure that the add events in jc.log actually appears AFTER you plugin anything?". If it a

Re: [systemd-devel] udev event on usb unpluged

2015-08-31 Thread christophe . jalady
; , "systemd" Envoyé: Samedi 29 Août 2015 19:54:20 Objet: Re: [systemd-devel] udev event on usb unpluged Are you sure that the add events in jc.log actually appears before you plugin anything? I think "usb1" is the host controller/bus and "usb1/1-0:1.0" is the interna

Re: [systemd-devel] udev event on usb unpluged

2015-08-29 Thread Tom Yan
swer. (thanks by the way!) > > Christophe > > > > - Mail original ----- > De: "Tom Yan" > À: "christophe jalady" > Cc: "Robert Milasan" , "systemd" > > Envoyé: Samedi 29 Août 2015 19:54:20 > Objet: Re: [systemd-devel] udev eve

Re: [systemd-devel] udev event on usb unpluged

2015-08-29 Thread christophe . jalady
De: "Tom Yan" À: "christophe jalady" Cc: "Robert Milasan" , "systemd" Envoyé: Samedi 29 Août 2015 19:54:20 Objet: Re: [systemd-devel] udev event on usb unpluged Are you sure that the add events in jc.log actually appears before you plugin anything? I think &quo

Re: [systemd-devel] udev event on usb unpluged

2015-08-29 Thread Tom Yan
n udev.log ?? > 2) Why is there no "usb" event in udev.log (nor add/change or remove ...) ? > > > For completeness, I attach also my .rule and .sh scripts. > > Thanks for your help. > > Christophe > > > > > - Mail original - > De: "Robert Milasa

Re: [systemd-devel] udev event on usb unpluged

2015-08-29 Thread christophe . jalady
v.log ?? 2) Why is there no "usb" event in udev.log (nor add/change or remove ...) ? For completeness, I attach also my .rule and .sh scripts. Thanks for your help. Christophe - Mail original - De: "Robert Milasan" À: "christophe jalady" Cc: systemd-deve

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread Tom Yan
Maybe there's indeed some problem with your kernel or device. I tried the following rule on my machine: /etc/udev/rules.d/usb.rules:SUBSYSTEM=="usb", RUN+="/usr/bin/bash -c 'echo $ACTION $DEVPATH >> /home/tom/test" And here's the "test" log after I reboot and plug/unplug a usb thumb drive (2-4): a

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread Robert Milasan
On Wed, 26 Aug 2015 15:32:13 +0200 (CEST) wrote: > >They are not referring to your device, but the machine on which you > >are > running the rule. > >In a terminal/console you run: udevadm monitor > >The do the removal itself and see what 'udevadm monitor' says. > > this is the problem: the mach

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread christophe . jalady
il original - De: "Robert Milasan" À: systemd-devel@lists.freedesktop.org Envoyé: Mercredi 26 Août 2015 13:49:44 Objet: Re: [systemd-devel] udev event on usb unpluged On Wed, 26 Aug 2015 14:43:35 +0200 (CEST) wrote: > >can you show how you confirmed your script receive the "

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread Robert Milasan
On Wed, 26 Aug 2015 14:43:35 +0200 (CEST) wrote: > >can you show how you confirmed your script receive the "add" event, > >or how the script "catch" the event? > > Sure: basically I do "echo "USB_$ACTION" >> /tmp/jc.log". > After plug/wait/unplugged/wait I only see lines "USB_add". > See attache

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread christophe . jalady
rocess directly from my device. Does the scripts provided are enough to help you understanding my problem ? Christophe - Mail original - De: "Tom Yan" À: "christophe jalady" Cc: "systemd" Envoyé: Mercredi 26 Août 2015 08:57:12 Objet: Re: [systemd-devel] u

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread Tom Yan
ugged the > cable. > When the cable is unplugged, I want to trigger an action on my device > (processing the files copied). > > Christophe > > > > - Mail original - > De: "Tom Yan" > À: "christophe jalady" > Cc: "systemd" >

Re: [systemd-devel] udev event on usb unpluged

2015-08-26 Thread christophe . jalady
phe - Mail original ----- De: "Tom Yan" À: "christophe jalady" Cc: "systemd" Envoyé: Mercredi 26 Août 2015 04:37:40 Objet: Re: [systemd-devel] udev event on usb unpluged Also it seems to be g_mass_storage is just the module for setting up dummy or emulating a

Re: [systemd-devel] udev event on usb unpluged

2015-08-25 Thread Tom Yan
Also it seems to be g_mass_storage is just the module for setting up dummy or emulating an mass storage device. Why would you want it to depend on a usb "cable"/device? On 26 August 2015 at 11:21, Tom Yan wrote: > I am not sure about what you mean here. Do you mean that you can't see > any remove

Re: [systemd-devel] udev event on usb unpluged

2015-08-25 Thread Tom Yan
I am not sure about what you mean here. Do you mean that you can't see any remove event with `udevadm monitor` when you unplug the "cable"? Also do you really mean a "usb cable" without any device connected to it on the other end? By the way the rule you set up is so broad that the script will bas

[systemd-devel] udev event on usb unpluged

2015-08-25 Thread christophe . jalady
Hi, I would like to receive an event (actually run a script) when I plug/unplugged an usb cable. I tried to use udev with this simple rule: SUBSYSTEM=="usb",RUN+="/var/local/usb-changed.sh" I do receive the "add" event when I plug the usb cable: just perfect ! But I never receive the "remove" e