Subject: Re: Suspend on NEC MP780?
To: Mattias Sandstrom <mattias@beauty.se>
From: Jimi Malcolm <malcolm@cc.gatech.edu>
List: port-hpcmips
Date: 02/18/2004 11:03:26
Check out onlogdo by Ben Wong:

http://www.cc.gatech.edu/~bbb/2001/onlogdo

It's a daemon that watches a log file and runs commands based on if it
sees certain events.  Here's an example from the web page where it
watches /var/log/messages for the insertion and ejection of your NIC and
runs dhclient appropriately.  You can probably do it for suspend;
however, I'm not sure if it'll have the time to execute taking down the
NIC before the device actually suspends.  Is there a way to slow down
the suspend sequence by a second or two?

$ onlogdo /var/log/messages \
       'ep0 at pcmcia' '/etc/rc.d/dhclient start' \
       'ep0 detached'  '/etc/rc.d/dhclient stop'  \
       'wi0 at pcmcia' '/etc/rc.d/dhclient start' \
       'wi0 detached'  '/etc/rc.d/dhclient stop'


Mattias Sandstrom (Wed@1056)
> Carl Wilhelm Soderstrom wrote:
> >>>is there any way to shut down a network card without root 
> >>>privileges?
> >
> >would sudo do the job for you?
> 
> sort of, better than nothing. i'll install it and see what i think. 
> thanks. having a daemon listening to the hpcapm device and calling a 
> script automatically when an event occurs would be better though. so 
> again, how does hpcapm communicate with the world? is it just the 
> console output? can i capture that somehow?
> 
> thanks,
> 
> 	/matt

-- 
Jimi