sorry for the delay.
Attached are the logs.

The log show the hole process meaning:
   Boot
   Plug of the usb cable: the device is shown as a "mass-storage" on the other 
device.
   Other device umount. I unplug the cable.
   Shutdown of the device.

'jc.log' is the log from my script. You will see 2 "add" event, but no "remove" 
event.
'udev.log' if the log from "udevadm monitor > /var/log/udev.log 2>&1" since 
boot time (I launch it from an init.d script at startup).


1) Why I see event in my jc.log but not in 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 Milasan" <[email protected]>
À: "christophe jalady" <[email protected]>
Cc: [email protected]
Envoyé: Mercredi 26 Août 2015 14:35:24
Objet: Re: [systemd-devel] udev event on usb unpluged

On Wed, 26 Aug 2015 15:32:13 +0200 (CEST)
<[email protected]> 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 machine which are running the rule is a
> "specific robotic device" with one usb port and no screen (and no
> network device). Either I connect through ssh using the usb cable
> (eth over usb) or I use the usb cable to test my plug/unplug process.
> I cannot have a console _and_ test the unplugging at the same time.

Then login into that machine and run screen, in which you run:
'udevadm monitor -u -p > /tmp/udev.log 2>&1'

Do the necessary removal of the usb cable or whatever, then attach
the usb cable again, login again and check the log.

> 
> Christophe
> 


-- 
Robert Milasan

L3 Support Engineer
SUSE Linux (http://www.suse.com)
email: [email protected]
GPG fingerprint: B6FE F4A8 0FA3 3040 3402  6FE7 2F64 167C 1909 6D1A

Attachment: usb-changed.sh
Description: application/shellscript

Attachment: 95-usb.rules
Description: Binary data

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[76.710918] change   /devices/platform/leds_pwm/leds/ev3-left1:green:ev3dev (leds)
KERNEL[76.753187] change   /devices/platform/leds_pwm/leds/ev3-right1:green:ev3dev (leds)
KERNEL[76.783563] change   /devices/platform/leds_pwm/leds/ev3-left0:red:ev3dev (leds)
KERNEL[76.814720] change   /devices/platform/leds_pwm/leds/ev3-left0:red:ev3dev (leds)
KERNEL[76.859972] change   /devices/platform/leds_pwm/leds/ev3-right0:red:ev3dev (leds)
KERNEL[76.904334] change   /devices/platform/leds_pwm/leds/ev3-right0:red:ev3dev (leds)
UDEV  [78.253965] change   /devices/platform/leds_pwm/leds/ev3-left1:green:ev3dev (leds)
UDEV  [78.309536] change   /devices/platform/leds_pwm/leds/ev3-right1:green:ev3dev (leds)
UDEV  [78.368676] change   /devices/platform/leds_pwm/leds/ev3-left0:red:ev3dev (leds)
UDEV  [78.447464] change   /devices/platform/leds_pwm/leds/ev3-right0:red:ev3dev (leds)
UDEV  [79.350682] change   /devices/platform/leds_pwm/leds/ev3-left0:red:ev3dev (leds)
UDEV  [79.408343] change   /devices/platform/leds_pwm/leds/ev3-right0:red:ev3dev (leds)
KERNEL[291.356497] change   /devices/platform/leds_pwm/leds/ev3-left1:green:ev3dev (leds)
KERNEL[291.382591] change   /devices/platform/leds_pwm/leds/ev3-left1:green:ev3dev (leds)
KERNEL[291.406296] change   /devices/platform/leds_pwm/leds/ev3-right1:green:ev3dev (leds)
KERNEL[291.441321] change   /devices/platform/leds_pwm/leds/ev3-right1:green:ev3dev (leds)
KERNEL[291.475845] change   /devices/platform/leds_pwm/leds/ev3-left0:red:ev3dev (leds)
KERNEL[291.708675] change   /devices/platform/leds_pwm/leds/ev3-right0:red:ev3dev (leds)
UDEV  [293.290931] change   /devices/platform/leds_pwm/leds/ev3-left1:green:ev3dev (leds)
UDEV  [293.442428] change   /devices/platform/leds_pwm/leds/ev3-right1:green:ev3dev (leds)
UDEV  [293.661357] change   /devices/platform/leds_pwm/leds/ev3-left0:red:ev3dev (leds)
UDEV  [293.739961] change   /devices/platform/leds_pwm/leds/ev3-right0:red:ev3dev (leds)
UDEV  [295.962372] change   /devices/platform/leds_pwm/leds/ev3-left1:green:ev3dev (leds)
UDEV  [296.208847] change   /devices/platform/leds_pwm/leds/ev3-right1:green:ev3dev (leds)
add /devices/platform/ohci.0/usb1
add /devices/platform/ohci.0/usb1/1-0:1.0
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to