Programming & DevOps
systemd udev Rules to Detect USB Device Plugging (including Bus and Device Number)
The other day, I was working on some udev rules to invoke a script when a USB device is added or removed from my machine. I needed the USB bus and USB port number to further process that event. I decided to use udev for that. However, getting the relevant attributes was not as intuitive as I expected, and existing documentation wasn’t that good. Here’s what I did and how I solved it. Read more…