linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ude/hotplug/usbmount
@ 2004-06-25  8:29 metzench
  2004-06-25 12:31 ` ude/hotplug/usbmount Simone Gotti
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: metzench @ 2004-06-25  8:29 UTC (permalink / raw)
  To: linux-hotplug

Hi All!

We are now using udev and hotplug for some months now, and so far
everything works fine. But now i wanted to install the usb-mount
script but it won't work when plugging in for example a usb stick,
because hotplug generates the dive nodes too late! Here is what the
logs say:

DEVPATH=/devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
Jun 25 01:36:18 CCuxAMD usb-mount:
REMOVER=/var/run/usb/%sys%devices%pci0000:00%0000:00:11.3%usb2%2-2%2-
2.1%2-2.1:1.0
Jun 25 01:36:18 CCuxAMD usb-mount: PATH=/bin:/sbin:/usr/sbin:/usr/bin
Jun 25 01:36:18 CCuxAMD usb-mount: ACTION­d
Jun 25 01:36:18 CCuxAMD usb-mount: PWD=/etc/hotplug
Jun 25 01:36:18 CCuxAMD usb-mount: HOME=/
Jun 25 01:36:18 CCuxAMD usb-mount: SHLVL=3
Jun 25 01:36:18 CCuxAMD usb-mount: DEVICE=/proc/bus/usb/002/006
Jun 25 01:36:18 CCuxAMD usb-mount: INTERFACE=8/5/80
Jun 25 01:36:18 CCuxAMD usb-mount: PRODUCTTc/8b/1
Jun 25 01:36:18 CCuxAMD usb-mount: TYPE=0/0/0
Jun 25 01:36:18 CCuxAMD usb-mount: SEQNUM(9
Jun 25 01:36:18 CCuxAMD usb-mount: _=/usr/bin/env
Jun 25 01:36:18 CCuxAMD usb-mount: ------
Jun 25 01:36:18 CCuxAMD scsi1 : SCSI emulation for USB Mass Storage
devices
Jun 25 01:36:18 CCuxAMD usb-mount: Cleaning up mounts for detached
devices.
Jun 25 01:36:18 CCuxAMD Vendor: Sony	  Model: Storage Media	  
Rev: PROL
Jun 25 01:36:18 CCuxAMD Type:	Direct-Access			  
ANSI SCSI revision: 02
Jun 25 01:36:18 CCuxAMD usb-mount: Called to mount device
/devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
Jun 25 01:36:18 CCuxAMD usb-mount: DEVPATH yields SCSI host number 1
Jun 25 01:36:18 CCuxAMD usb-mount: SCSI disk device for 1 is UNKNOWN
Jun 25 01:36:18 CCuxAMD usb-mount: Disk device is UNKNOWN
Jun 25 01:36:18 CCuxAMD usb-mount: SCSI disk device is UNKNOWN
Jun 25 01:36:18 CCuxAMD usb-mount: Could not find device for
/devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
Jun 25 01:36:18 CCuxAMD usb-mount: Checking for unused mountpoints
Jun 25 01:36:18 CCuxAMD SCSI device sda: 256000 512-byte hdwr sectors
(131 MB)
Jun 25 01:36:18 CCuxAMD sda: assuming Write Enabled
Jun 25 01:36:18 CCuxAMD sda: sda1
Jun 25 01:36:18 CCuxAMD Attached scsi removable disk sda at scsi1,
channel 0, id 0, lun 0
Jun 25 01:36:18 CCuxAMD Attached scsi generic sg0 at scsi1, channel
0, id 0, lun 0,  type 0

When i call usb-mount in a console, it works fine and the desktop
icon gets created.

Has anyone any suggestions for this?

Best regards,

Christian Metzen


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ude/hotplug/usbmount
  2004-06-25  8:29 ude/hotplug/usbmount metzench
@ 2004-06-25 12:31 ` Simone Gotti
  2004-06-25 12:45 ` ude/hotplug/usbmount Marcelo Ricardo Leitner
  2004-06-25 13:08 ` ude/hotplug/usbmount metzench
  2 siblings, 0 replies; 4+ messages in thread
From: Simone Gotti @ 2004-06-25 12:31 UTC (permalink / raw)
  To: linux-hotplug

On Friday 25 June 2004 10:29, metzench@ccux.de wrote:
> Hi All!
>
> We are now using udev and hotplug for some months now, and so far
> everything works fine. But now i wanted to install the usb-mount
> script but it won't work when plugging in for example a usb stick,
> because hotplug generates the dive nodes too late! Here is what the
> logs say:
>
> DEVPATH=/devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount:
> REMOVER=/var/run/usb/%sys%devices%pci0000:00%0000:00:11.3%usb2%2-2%2-
> 2.1%2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount: PATH=/bin:/sbin:/usr/sbin:/usr/bin
> Jun 25 01:36:18 CCuxAMD usb-mount: ACTION­d
> Jun 25 01:36:18 CCuxAMD usb-mount: PWD=/etc/hotplug
> Jun 25 01:36:18 CCuxAMD usb-mount: HOME=/
> Jun 25 01:36:18 CCuxAMD usb-mount: SHLVL=3
> Jun 25 01:36:18 CCuxAMD usb-mount: DEVICE=/proc/bus/usb/002/006
> Jun 25 01:36:18 CCuxAMD usb-mount: INTERFACE=8/5/80
> Jun 25 01:36:18 CCuxAMD usb-mount: PRODUCTTc/8b/1
> Jun 25 01:36:18 CCuxAMD usb-mount: TYPE=0/0/0
> Jun 25 01:36:18 CCuxAMD usb-mount: SEQNUM(9
> Jun 25 01:36:18 CCuxAMD usb-mount: _=/usr/bin/env
> Jun 25 01:36:18 CCuxAMD usb-mount: ------
> Jun 25 01:36:18 CCuxAMD scsi1 : SCSI emulation for USB Mass Storage
> devices
> Jun 25 01:36:18 CCuxAMD usb-mount: Cleaning up mounts for detached
> devices.
> Jun 25 01:36:18 CCuxAMD Vendor: Sony	  Model: Storage Media
> Rev: PROL
> Jun 25 01:36:18 CCuxAMD Type:	Direct-Access
> ANSI SCSI revision: 02
> Jun 25 01:36:18 CCuxAMD usb-mount: Called to mount device
> /devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount: DEVPATH yields SCSI host number 1
> Jun 25 01:36:18 CCuxAMD usb-mount: SCSI disk device for 1 is UNKNOWN
> Jun 25 01:36:18 CCuxAMD usb-mount: Disk device is UNKNOWN
> Jun 25 01:36:18 CCuxAMD usb-mount: SCSI disk device is UNKNOWN
> Jun 25 01:36:18 CCuxAMD usb-mount: Could not find device for
> /devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount: Checking for unused mountpoints
> Jun 25 01:36:18 CCuxAMD SCSI device sda: 256000 512-byte hdwr sectors
> (131 MB)
> Jun 25 01:36:18 CCuxAMD sda: assuming Write Enabled
> Jun 25 01:36:18 CCuxAMD sda: sda1
> Jun 25 01:36:18 CCuxAMD Attached scsi removable disk sda at scsi1,
> channel 0, id 0, lun 0
> Jun 25 01:36:18 CCuxAMD Attached scsi generic sg0 at scsi1, channel
> 0, id 0, lun 0,  type 0
>
> When i call usb-mount in a console, it works fine and the desktop
> icon gets created.
>
> Has anyone any suggestions for this?
>
> Best regards,
>
> Christian Metzen

If you are using udev, you have to put the script in /etc/dev.d and for 
example in the block subdir (create it if it desn't exists). Then you have to 
rename it with the .dev extension instead of the .hotplug

Because the script must be called after the nodes are created by udev.


Bye!
-- 
Simone Gotti
<simone.gotti@email.it>


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ude/hotplug/usbmount
  2004-06-25  8:29 ude/hotplug/usbmount metzench
  2004-06-25 12:31 ` ude/hotplug/usbmount Simone Gotti
@ 2004-06-25 12:45 ` Marcelo Ricardo Leitner
  2004-06-25 13:08 ` ude/hotplug/usbmount metzench
  2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2004-06-25 12:45 UTC (permalink / raw)
  To: linux-hotplug

On Sex Jun 25, 2004 at 10:29:39 +0200, metzench@ccux.de wrote:
> Hi All!
> 
> We are now using udev and hotplug for some months now, and so far
> everything works fine. But now i wanted to install the usb-mount
> script but it won't work when plugging in for example a usb stick,
> because hotplug generates the dive nodes too late! Here is what the
> logs say:
> 
> DEVPATH=/devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount:
> REMOVER=/var/run/usb/%sys%devices%pci0000:00%0000:00:11.3%usb2%2-2%2-
> 2.1%2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount: PATH=/bin:/sbin:/usr/sbin:/usr/bin
> Jun 25 01:36:18 CCuxAMD usb-mount: ACTION­d
> Jun 25 01:36:18 CCuxAMD usb-mount: PWD=/etc/hotplug
> Jun 25 01:36:18 CCuxAMD usb-mount: HOME=/
> Jun 25 01:36:18 CCuxAMD usb-mount: SHLVL=3
> Jun 25 01:36:18 CCuxAMD usb-mount: DEVICE=/proc/bus/usb/002/006
> Jun 25 01:36:18 CCuxAMD usb-mount: INTERFACE=8/5/80
> Jun 25 01:36:18 CCuxAMD usb-mount: PRODUCTTc/8b/1
> Jun 25 01:36:18 CCuxAMD usb-mount: TYPE=0/0/0
> Jun 25 01:36:18 CCuxAMD usb-mount: SEQNUM(9
> Jun 25 01:36:18 CCuxAMD usb-mount: _=/usr/bin/env
> Jun 25 01:36:18 CCuxAMD usb-mount: ------
> Jun 25 01:36:18 CCuxAMD scsi1 : SCSI emulation for USB Mass Storage
> devices
> Jun 25 01:36:18 CCuxAMD usb-mount: Cleaning up mounts for detached
> devices.
> Jun 25 01:36:18 CCuxAMD Vendor: Sony	  Model: Storage Media	  
> Rev: PROL
> Jun 25 01:36:18 CCuxAMD Type:	Direct-Access			  
> ANSI SCSI revision: 02
> Jun 25 01:36:18 CCuxAMD usb-mount: Called to mount device
> /devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount: DEVPATH yields SCSI host number 1
> Jun 25 01:36:18 CCuxAMD usb-mount: SCSI disk device for 1 is UNKNOWN
> Jun 25 01:36:18 CCuxAMD usb-mount: Disk device is UNKNOWN
> Jun 25 01:36:18 CCuxAMD usb-mount: SCSI disk device is UNKNOWN
> Jun 25 01:36:18 CCuxAMD usb-mount: Could not find device for
> /devices/pci0000:00/0000:00:11.3/usb2/2-2/2-2.1/2-2.1:1.0
> Jun 25 01:36:18 CCuxAMD usb-mount: Checking for unused mountpoints
> Jun 25 01:36:18 CCuxAMD SCSI device sda: 256000 512-byte hdwr sectors
> (131 MB)
> Jun 25 01:36:18 CCuxAMD sda: assuming Write Enabled
> Jun 25 01:36:18 CCuxAMD sda: sda1
> Jun 25 01:36:18 CCuxAMD Attached scsi removable disk sda at scsi1,
> channel 0, id 0, lun 0
> Jun 25 01:36:18 CCuxAMD Attached scsi generic sg0 at scsi1, channel
> 0, id 0, lun 0,  type 0
> 
> When i call usb-mount in a console, it works fine and the desktop
> icon gets created.
> 
> Has anyone any suggestions for this?
---end quoted text---

I'm not using udev yet, but I do have hotplug/usb-mount working. For that, I
use a /etc/hotplug/usb/usb-module a bit different from the one provided by
usb-mount. Here it is:

[root@idolize root]# cat /etc/hotplug/usb/usb-storage
#!/bin/bash

/usr/bin/logger -t usb-storage -p user.notice "$ACTION DEVICE=$DEVICE DEVPATH=$DEVPATH"

if [ "$ACTION" = "add" ]
then
    # Sleep a while, until $DEVICE exist
    tries=5
    [ -n "$DEVICE" ] && file="$DEVICE" || file="$DEVPATH"
    while [ ! -e "$file" -a "$tries" -ne 0 ]; do
        sleep 1
        tries=$(($tries-1))
    done

    /usr/bin/logger -t usb-storage -p user.notice "Adding $file"
    /usr/sbin/usb-mount < /dev/null 1> /dev/null 2>&1
fi


Note that it waits the DEVICE/DEVPATH be created before calling usb-monut,
and timeout after 5 tries (1 try per second).

hope it helps.
-- 
Marcelo Ricardo Leitner <mrl@conectiva.com.br>


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ude/hotplug/usbmount
  2004-06-25  8:29 ude/hotplug/usbmount metzench
  2004-06-25 12:31 ` ude/hotplug/usbmount Simone Gotti
  2004-06-25 12:45 ` ude/hotplug/usbmount Marcelo Ricardo Leitner
@ 2004-06-25 13:08 ` metzench
  2 siblings, 0 replies; 4+ messages in thread
From: metzench @ 2004-06-25 13:08 UTC (permalink / raw)
  To: linux-hotplug

Well now i put it in /etc/dev.d/block and it gets started, but
happening is nothing. I deleleted the sugested entry in hotplug.agent
cause i think it shouldn't be there then anymore or am i wrong?

Here is what the log says:

Jun 25 15:05:54 CCuxAMD udev[16006]: creating device node '/dev/sg0'
Jun 25 15:05:54 CCuxAMD udev[16007]: creating device node '/dev/sda'
Jun 25 15:05:54 CCuxAMD udev[16008]: creating device node '/dev/sda1'
Jun 25 15:05:54 CCuxAMD usb-mount.dev: +++ Starting usb (u)mounter
block DEVPATH=/block/sda SCSIJun 25 15:05:54 CCuxAMD usb-mount.dev: ------
Jun 25 15:05:54 CCuxAMD usb-mount.dev: DEVPATH=/block/sda
Jun 25 15:05:54 CCuxAMD usb-mount.dev: ACTION­d
Jun 25 15:05:54 CCuxAMD usb-mount.dev: PWD=/
Jun 25 15:05:54 CCuxAMD usb-mount.dev: DEVNAME=/dev/sda
Jun 25 15:05:54 CCuxAMD usb-mount.dev: SHLVL=1
Jun 25 15:05:54 CCuxAMD usb-mount.dev: _=/usr/bin/env
Jun 25 15:05:54 CCuxAMD usb-mount.dev: ------
Jun 25 15:05:54 CCuxAMD usb-mount.dev: Cleaning up mounts for
detached devices.
Jun 25 15:05:55 CCuxAMD usb-mount.dev: +++ Starting usb (u)mounter
block DEVPATH=/block/sda/sda1 SCSIJun 25 15:05:55 CCuxAMD usb-mount.dev: ------
Jun 25 15:05:55 CCuxAMD usb-mount.dev: DEVPATH=/block/sda/sda1
Jun 25 15:05:55 CCuxAMD usb-mount.dev: ACTION­d
Jun 25 15:05:55 CCuxAMD usb-mount.dev: PWD=/
Jun 25 15:05:55 CCuxAMD usb-mount.dev: DEVNAME=/dev/sda1
Jun 25 15:05:55 CCuxAMD usb-mount.dev: SHLVL=1
Jun 25 15:05:55 CCuxAMD usb-mount.dev: _=/usr/bin/env
Jun 25 15:05:55 CCuxAMD usb-mount.dev: ------
Jun 25 15:05:55 CCuxAMD usb-mount.dev: Cleaning up mounts for
detached devices.
Jun 25 15:05:55 CCuxAMD usb-mount.dev: Checking for unused
mountpoints
Jun 25 15:05:55 CCuxAMD usb-mount.dev: Checking for unused
mountpoints

Best regards,

Christian Metzen


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-06-25 13:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-25  8:29 ude/hotplug/usbmount metzench
2004-06-25 12:31 ` ude/hotplug/usbmount Simone Gotti
2004-06-25 12:45 ` ude/hotplug/usbmount Marcelo Ricardo Leitner
2004-06-25 13:08 ` ude/hotplug/usbmount metzench

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).