You are not logged in.
Pages: 1
My goal is to do different things, whenever a usb device is plugged in. I found out the kernel-path to my usb-stick when i plug it in which is
/devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/block/sda
I can now run
udevadm info -a -p /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/block/sda
which gives me a lot of useful stuff that i won't post here, unless it's necessary (please tell me, if it is!). I wrote a simple udev rule:
tim@x1carbon ~> cat /etc/udev/rules.d/10-rule.rules
SUBSYSTEMS=="usb",ACTION=="add", ATTRS{ID_SERIAL}=="SanDisk_Ultra_Fit_4C530123260812112220", RUN+="/usr/bin/touch /home/tim/test.txt"⏎
tim@x1carbon ~>
And ran
udevadm control -R
to reload udev. When i now test with
udevadm test /devices/pci0000:00/0000:00:14.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/block/sda
My rule shows up, but when i plug in my device, nothing happens. Can someone help me out?
Last edited by Tim.Hilt (2019-02-12 21:57:37)
Offline
Post the output of the 'udevadm info' command.
You can monitor udev with 'udevadm monitor' in another console, to see what happens when you plug the device in.
Post also the output of the 'udevadm test' command.
Offline
Offline
I think that it had something to do with how cluttered my system was. I did a clean install and now everything works as it should. Marking as solved.
Offline
Pages: 1