Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 65202

Summary: Hotplug doesn't call script in /etc/hotplug/usb by the same name of the module loaded
Product: [Retired] Red Hat Linux Reporter: Nathan G. Grennan <redhat-bugzilla>
Component: hotplugAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-20 05:32:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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:
Always

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