Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to execute a certain Python script on USB devices insertion. I need to handle all kinds of USB devices. I'm using a rule like this:

SUBSYSTEMS=="usb", ENV{DEVTYPE}=="usb_device", RUN+="/.../ $devpath"

When I insert a USB flash drive, the script is not executed. If I use a rule like this:

SUBSYSTEM=="usb", RUN+="/.../ $devpath"

I catch events for the /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.2/1-1.2:1.0, which is the default configuration of the device; but I don't get any events for /devices/pci0000:00/0000:00:02.1/usb1/1-1/1-1.2. I do see such events with udevadm monitor, though. Why does it happen? Am I missing something?

My distro is current Arch Linux.

share|improve this question
up vote 0 down vote accepted

I have found the source of the problem. It turned out to be caused by a VirtualBox rule that overrode my own rule.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.