I have two rules one for when a device, my phone, is connected and one for when it is disconnected. The rule for add runs the remove rule does not. Here is my udev rule. I simplified but the remove event does not run.
#RUNS:
KERNEL=="sd?1", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ff9", SYMLINK+="phone", ACTION=="add", RUN+="/usr/bin/touch /tmp/udev.add"
#DOES NOT RUN:
KERNEL=="sd?1", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ff9", SYMLINK+="phone", ACTION=="remove", RUN+="/usr/bin/touch /tmp/udev.remove"
Why would one run but not the other?
ENV{VAR}==
instead of theATTRS{VAR}==
and the command above is how you can get the environment variables to filter on. Thank you. – Andrew Redd Oct 13 '11 at 15:38