Bug 144537 - devlabel not automounting when run by hotplug
devlabel not automounting when run by hotplug
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: devlabel (Show other bugs)
3.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
:
: 102056 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-07 17:35 EST by Tom Parris
Modified: 2007-11-30 17:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-11 08:09:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom Parris 2005-01-07 17:35:50 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.3)
Gecko/20040924

Description of problem:
devlabel does not automount a usb memory stick when from from hotplug.
 However, it does when run by hand (/sbin/devlabel restart).

# relevent messages from /var/log/messages
Jan  7 17:09:46 magnolia /etc/hotplug/usb.agent: Setup usb-storage for
USB product d7d/100/100
Jan  7 17:09:46 magnolia devlabel: devlabel's temporary ignore list
/etc/sysconfig/devlabel.d/ignore_list has been emptied due to a change
in device configuration.
Jan  7 17:09:46 magnolia kernel: SCSI device sda: 256000 512-byte hdwr
sectors (131 MB)
Jan  7 17:09:46 magnolia kernel: sda: Write Protect is off
Jan  7 17:09:46 magnolia kernel:  sda: sda1
Jan  7 17:09:48 magnolia devlabel: devlabel service started/restarted
Jan  7 17:09:49 magnolia devlabel: The symlink /dev/memstick ->
/dev/sda1 is being ignored in /etc/sysconfig/devlabel because the
correct device cannot be found.

# relevant messages when run by hand
[root@magnolia sysconfig]# /sbin/devlabel restart
SYMLINK: /dev/memstick -> /dev/sda1
[root@magnolia sysconfig]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
[stuff deleted]
/dev/memstick           126566    116732      9834  93% /mnt/memstick

# fstab entry
/dev/memstick           /mnt/memstick           auto    noauto,owner 0 0

# /etc/sysconfig/devlabel
/dev/memstick /dev/sda1 S:IMCKanguruMicrosector32 automount





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

How reproducible:
Always

Steps to Reproduce:
1. umount /mnt/memstick
2. remove memory stick from usb port
3. insert memory stik into usb port
4. get error in /var/log/messages 
"The symlink /dev/memstick -> /dev/sda1 is being ignored in
/etc/sysconfig/devlabel because the correct device cannot be found."
5. /sbin/devlabel restart
"SYMLINK: /dev/memstick -> /dev/sda1"
6. verify device mounted (e.g., ls /mnt/memstick)
    

Additional info:

This may be a timing issue.  Is it possible that hotplug is running
devlabel before the new usb device is recognized and bound to /dev/sda1?

This may also be related to bug id#102056 (devlabel needs to be run twice)
Comment 1 Bill Nottingham 2005-01-07 17:40:35 EST
Do the fixes in bug 144241 work for you?
Comment 2 Tom Parris 2005-01-10 08:34:34 EST
Thanks for the quick response.  I tried the patch.  Unfortunately, it
did not appear to change the behavior reported above.
Comment 3 Bill Nottingham 2005-01-21 18:14:42 EST
*** Bug 102056 has been marked as a duplicate of this bug. ***
Comment 4 Karel Zak 2005-07-21 05:25:49 EDT
Yes, it seems like timing problem, but I have no idea how we can decide when we
should wait for device and when it's correct that the device doesn't exist.

Any idea?
Comment 5 Tom Parris 2005-07-21 10:21:01 EDT
I'm far from an expert on the internals of hotplug and devlabel.  But it seems
that when hotplug detects the new device, it should wait until the device
(/dev/sda1 in the example above) is ready before calling devlabel to mount it.  

Isn't this as simple as a loop waiting for the device to show up in the file
system?  The delay between checks could be fairly long (1 second) since this is
not a time sensitive task.

This could also be done in usb.agent, but I think it better done in hotplug
since this would be a common issue across all buses.

My two bits.

Comment 6 Karel Zak 2005-07-21 11:26:29 EDT
I think hotplug doesn't detect any device. It calls modprobe and all depends on
kernel modules. I'm really not sure that kernel must always create
/dev/something. It depends on type of USB/PCMCIA/etc.

Add CC: to hotplug maintainer. 
Comment 7 Bill Nottingham 2005-07-21 11:39:28 EDT
Realistically, it should probably be running from the SCSI hotplug event, not
the USB one.

However, the 2.4 kernel doesn't generate SCSI hotplug events. That makes this
awfully hard to fix.
Comment 8 Karel Zak 2005-10-11 08:09:59 EDT
Sorry, it seems like WONTFIX. Closing.

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