When installing my USB camera with hotplug support, I found out the hotplug system was borked for removal events. Let me explain: The file /var/run/usb/(uniquename) is identified by gentoo as a place for a hotplug script in /etc/hotplug/usb/ to use for removal (unplugging) actions. There is no /var/run/usb/ directory though, so trying to write to this file fails. Also, this file is not touched by gentoo to be an executable script, so the user-made hotplug script has to go and change the permissions of this file, once its created, to be able to be executed by the gentoo hotplug removal script (in /etc/hotplug/usb.agent) Problems: 1) /var/run/usb/ directory does not exist and should. 2) The removal file is not by default executable, and should be. Solutions: 1) Create a /var/run/usb directory. 2) touch the $REMOVAL file and make it executable, or, use source $REMOVAL to execute it in the usb.agent file. Workaround: 1) mkdir /var/run/usb (once) 2) chmod a+x $REMOVAL (every time) Finding out why this thing was acting this way was kindof a pain, so while the workaround ends up being easy, finding it was not really that easy for me. Due to the large amount of systems with udev/hotplug in gentoo out there, I categorized this problem as MAJOR. Cheers, Reproducible: Always Steps to Reproduce: 1. Edit /etc/hotplug/usb.usermap to execute a file (say usbcamera) located in /etc/hotplug/usb/. 2. Have that script try to put stuff in that file: echo /my/removal/actions >> $REMOVAL Actual Results: Nothing! Expected Results: Executed $REMOVAL upon removal of the usb device.
As this is something that is _not_ a normal action, and requires you to write your own removal script, the 2 steps you have to go through to have this work, seems pretty reasonable to me. Actually, the whole REMOVAL stuff is a mess, I recommend just using the /etc/dev.d/ process instead. It gives you a lot more information about the device that was removed.
So hotplug.d/ is now deprecated?
*** Bug 130789 has been marked as a duplicate of this bug. ***