linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* I don't want much...
@ 2004-07-24 21:34 David Greaves
  2004-07-24 21:59 ` Olivier Mehani
  0 siblings, 1 reply; 2+ messages in thread
From: David Greaves @ 2004-07-24 21:34 UTC (permalink / raw)
  To: linux-hotplug

Hi

This overview page:
  http://linux-hotplug.sourceforge.net/?selected=overview
Says that a "Starting an application" is a reasonable thing to want to do.

I just want to run a script.
A simple script.
That's it.
Why on earth is it so hard?

Hmm, maybe not the best tone to start with - but isn't hotplugging about 
making the user's life easier?
It's cool that it automatically loads my modules.
Now all I have to do is start a shell and type: mount -t vfat -o 
uidÚvid,gid=greaves,sync /dev/sda1 /mnt/lexar
Not exactly plug-and-play is it?

When I plug in my Lexar Jumpshot I want to mount the drive and rsync my 
piccies.
What happens?
I get a usb event
then a scsi-host event
then a scsi event
then a block event
and another block event
then a scsi-device event

Fine.
So I add a usermap tied to the usb vendor/product id (the 'right' place) 
and create a dummy module called lexar.script with a control script.
It runs - good.
At the wring time (ie before the scsi devices are registered) - bad.

Do I really have to hack into the generic scsi-device agent?


David



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_idG21&alloc_id\x10040&op=click
_______________________________________________
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] 2+ messages in thread

* Re: I don't want much...
  2004-07-24 21:34 I don't want much David Greaves
@ 2004-07-24 21:59 ` Olivier Mehani
  0 siblings, 0 replies; 2+ messages in thread
From: Olivier Mehani @ 2004-07-24 21:59 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

On Sat, 24 Jul 2004 22:34:35 +0100
David Greaves <david@dgreaves.com> wrote:

> Now all I have to do is start a shell and type: mount -t vfat -o 
> uid=david,gid=greaves,sync /dev/sda1 /mnt/lexar
(...)
> When I plug in my Lexar Jumpshot I want to mount the drive and rsync
> my piccies.
(...)
> So I add a usermap tied to the usb vendor/product id (the 'right'
> place) and create a dummy module called lexar.script with a control
> script. It runs - good.
> At the wring time (ie before the scsi devices are registered) - bad.

It worked well for me with my usb stick, I put the script, called the
same as the entry in the usb.usermap file, in the /etc/hotplug/usb
directory, and it worked well, but I assumed the block device was always
named the same.

What did put in your script ?

Mine follows:

----->8---cut-here---------
#!/bin/bash
logger -t usbbar Mounting...
err_mesg=`/bin/mount /key 2>&1`
if [ "$?" == "0" ]; then
        logger -t usbbar OK 
else
        logger -t usbbar Error: $err_mesg 
fi
----->8---cut-here---------

(BTW, I had an entry in my fstab)

However, my best advice would be to use udev, and not hotplug only, and
to use the dev.d scripts.

-- 
Olivier Mehani <shtrom@ssji.net>
PGP fingerprint = 3720 A1F7 1367 9FA3 C654  6DFB 6845 4071 E346 2FD1

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2004-07-24 21:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-24 21:34 I don't want much David Greaves
2004-07-24 21:59 ` Olivier Mehani

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).