I've written file 90-usb.rules under /etc/udev/rules.d/ containing:
ACTION=="add", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="2008", RUN+="/bin/mkdir /home/pandya/Desktop/testdir"
ACTION=="remove", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="2008", RUN+="/bin/rmdir /home/pandya/Desktop/testdir"
When I plugged in device udev ACTION=="add" creates directory by means of RUN+="/bin/mkdir /home/pandya/Desktop/testdir" (which works fine)
BUT when I unplugged device similar udev ACTION=="remove doesn't removes directory by means of RUN+="/bin/rmdir /home/pandya/Desktop/testdir"
There is no problem with /bin/rmdir because I've also checked by replacing it with another mkdir (RUN+="/bin/mkdir /home/pandya/Desktop/testdir2") but this also not working.
So, I want to know that Why removal action is not working? How do I fix it?