Re: mount filesystem and run a program when hotplugged

2002-07-06 Thread Bill Stewart

At 05:29 PM 06/28/2002 +0200, Eugen Leitl wrote:
I've bought me a little (32 MBytes) hotpluggable USB flash stick (a
TrekStor). It mounts fine, but what I'd like to do is to automount it, and
fire up a program (I intend to put my keyring on it) if hotplugged.

The system I'm testing this on is RH 7.3.

I've been using mount -t vfat /dev/sda /mnt/usbhd to mount it manually and
put diverse entries into /etc/fstab, to no avail. Any suggestions?

I don't know how to do that, though it certainly sounds like an
invitation for viruses to migrate around on USB keyring sticks.

Is there CDROM autorun code that runs on Linux that could be adapted?




Re: mount filesystem and run a program when hotplugged

2002-06-29 Thread Pawe Krawczyk

On Fri, Jun 28, 2002 at 05:29:17PM +0200, Eugen Leitl wrote:

 I've bought me a little (32 MBytes) hotpluggable USB flash stick (a
 TrekStor). It mounts fine, but what I'd like to do is to automount it, and
 fire up a program (I intend to put my keyring on it) if hotplugged.

You need to enable hot-pluggable devices in your kernel configuration
(along with USB storage stuff as well of course). Then, when you insert
the flash, kernel will automagically load all necessary drivers and
call /sbin/hotplug (path set in /proc), which can be a shell script.
From here you can do everything you want. Actually, those flash devices
are quite cool, I'm using them to distribute configuration, keys and
software upgrades on my security gateways etc., so feel free to ask if
you have any problems.

-- 
Pawe3 Krawczyk * http://echelon.pl/kravietz/
Krakow, Poland * http://ipsec.pl/




Re: mount filesystem and run a program when hotplugged

2002-06-29 Thread Pawe Krawczyk

On Fri, Jun 28, 2002 at 05:29:17PM +0200, Eugen Leitl wrote:

 I've bought me a little (32 MBytes) hotpluggable USB flash stick (a
 TrekStor). It mounts fine, but what I'd like to do is to automount it, and
 fire up a program (I intend to put my keyring on it) if hotplugged.

You need to enable hot-pluggable devices in your kernel configuration
(along with USB storage stuff as well of course). Then, when you insert
the flash, kernel will automagically load all necessary drivers and
call /sbin/hotplug (path set in /proc), which can be a shell script.
From here you can do everything you want. Actually, those flash devices
are quite cool, I'm using them to distribute configuration, keys and
software upgrades on my security gateways etc., so feel free to ask if
you have any problems.

-- 
Pawe3 Krawczyk * http://echelon.pl/kravietz/
Krakow, Poland * http://ipsec.pl/