I just want to trigger a shell script

Kent Schumacher kent at structural-wood.com
Tue Dec 13 06:31:39 PST 2005


Bill Paxton wrote:
> Hi all.
> 
> Uhm, do I have to write a resident task to listen for announcements and react? I don't want a
> connection manager daemon, be it the simple python example script nor something like ivman, g-v-m,
> etc. I just want to run a bash script when a device shows up. That's it. It can't care who's
> logged in nor what's running and it has to be GUI independent and I'd like it to be library /
> distro independent as possible. 
> 
> When hotplug was controlling the show, doing it via *.usermap shell script with CASE statements
> looping and sleeping and checking, ah well but it worked fine. But somehow that's broken after a
> dist upgrade (FC4) and either I can find a way to get it to work again, or work within "the new
> order". I thought it would be as simple as appending another info.callouts.add to execute my shell
> script, but apparently there's more to it than that.
> 
> Any suggestions on how I could do this? If not, is there a simple way to detach hal from affecting
> hotplug so the old way works? It stalls for a timeout; I sleep my usermap script waiting for the
> device & mount to show up, which doesn't occur for two minutes. No devices created, no fstab-sync
> callout. I found an archive message from Kay re: "/sbin/hotplug and hal.dev timeouts" but no joy.
> Any idea what this stall is?
> 
> TIA
> My hal education continues...
> 
> 2.6.14, hotplug 2004_09_23, hal 0.5.2, udev 058, dbus 0.33
> 

I don't really have a clue what I'm talking about, but I did exactly 
what you are talking about to handle mounting and unmounting of devices 
that showed up in /media, and it has been working well for a while now.

I'm pressed for time right now and didn't keep great notes, but I think 
I simply copied the 90-fstab-sync.fdi to an appropriately named file in 
my own directory in /usr/share/hal/fdi/policy and hacked it up to call a 
bash script that acted on the environment variables present when it was 
invoked by hal.

I wasn't really able to definitively pin down the meanings of many of 
the variables but over time I seem to have gotten something that works.




More information about the hal mailing list