Bug 65202 - Hotplug doesn't call script in /etc/hotplug/usb by the same name of the module loaded
Summary: Hotplug doesn't call script in /etc/hotplug/usb by the same name of the modul...
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: hotplug   
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2002-05-20 03:58 UTC by Nathan G. Grennan
Modified: 2014-03-17 02:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-20 05:32:24 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Nathan G. Grennan 2002-05-20 03:58:48 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.1 (X11; Linux i686; U;) Gecko/20020510

Description of problem:
I have a USB drive that when plugged into a USB port gets detected by the kernel
and setup automatically as sda via hotplug.
I have been trying to piece together how hotplug is supposed to work all day. It
is my understanding that the kernel calls /sbin/hotplug, hotplug calls the
correct agent script(in this case usb.agent), usb.agent is supposed to load the
correct module and call a script by the same name in /etc/hotplug/usb. Hotplug
does seem to do everything but call the script, which is in my case usb-storage.
I have tried setting up the correct line in /etc/hotplug/usb.usermap for my
device, but that didn't seem to help and from what I read on the hotplug mailing
list isn't required. I have tried turning on DEBUG=yes, which was helpful in
understading how hotplug worked and making sure it was doing what I expect, but
didn't help me figure it out. I also tried adding a blunt touch /tmp/foobar into
my script to make sure that it was just exiting in some state that had not effect.
I have also tried adding the contents of my /etc/hotplug/usb/usb-storage script
directly into usb.agent in the right places. It works great that way, but that
isn't the way hotplug is intended to work.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install RedHat 7.3
2. Make sure hotplug is installed, and if not install it
3. Create a script in /etc/hotplug/usb called usb-storage to do some function
when adding or removing
4. Make the script executable
5. Plug in a USB Mass Storage device

Actual Results:  /sbin/hotplug is called by the kernel. Hotplug calls
/etc/hotplug/usb.agent. usb.agent loads the module usb-storage.
/etc/hotplug/usb/usb-storage IS NOT called by usb.agent.

Expected Results:  /sbin/hotplug is called by the kernel. Hotplug calls
/etc/hotplug/usb.agent. usb.agent loads the module usb-storage.
/etc/hotplug/usb/usb-storage IS called by usb.agent.

Additional info:

The reason I need the script is that the scsi subsystem doesn't automatically
remove devices from it's list in /proc/scsi/scsi when they are removed. So I
need a script that will add the device to /proc/scsi/scsi on plug in if it is
the second time since last boot that the device has been plugged in. The first
time it adds it automatically. I also need the script to remove the device from
/proc/scsi/scsi when the device is unplugged.

Comment 1 Nathan G. Grennan 2004-08-20 05:32:24 UTC
Closing really old bug

Note You need to log in before you can comment on or make changes to this bug.