When I look at the output of udevadm monitor
for an USB device, there are KERNEL
and UDEV
events.
Can I only address the UDEV
events with a udev rule?
$ udevadm monitor | grep "mouse"KERNEL[122.593013] add /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7:1.0/0003:1234:5678:0006/input/input12/mouse1 (input)UDEV [123.643263] add /devices/pci0000:00/0000:00:14.0/usb3/3-7/3-7:1.0/0003:1234:5678:0006/input/input12/mouse1 (input)
I've tried:
ACTION=="add" \, SUBSYSTEM=="input" \, UDEV=="mouse*" \, ATTRS{idVendor}=="1234" \, ATTRS{idProduct}=="5678" \, RUN+="/usr/local/bin/do_something.sh"
I'm using Ubuntu 18.04 (Kernel:4.15.0-72-generic
).