Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 67115 - Hotplug REMOVAL actions borked
Summary: Hotplug REMOVAL actions borked
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Greg Kroah-Hartman (RETIRED)
URL:
Whiteboard:
Keywords:
: 130789 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-11 08:32 UTC by Steven Hay
Modified: 2007-01-15 15:14 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Hay 2004-10-11 08:32:53 UTC
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.
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-10-12 11:49:22 UTC
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.
Comment 2 Steven Hay 2004-10-14 20:26:50 UTC
So hotplug.d/ is now deprecated?
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-01-15 15:14:43 UTC
*** Bug 130789 has been marked as a duplicate of this bug. ***