Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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+="/.../test.py $devpath"

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

SUBSYSTEM=="usb", RUN+="/.../test.py $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

1 Answer 1

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

 
discard

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.