Re: apm & auto-shutdown

From: Dumas Patrice (dumas@centre-cired.fr)
Date: Wed Aug 30 2000 - 16:28:07 CEST


Hi,

Vesa-Pekka Palmu a écrit :

> I remember that I once saw a little script that would sit on the
> backround and watch /proc/apm and when the battery life would
> drop lower that pre-determined level It would first give a warning to
> all consoles about fortcomming shutdown (Battery life low,
> automatic shutdown in 5 minutes) If bu that time the laptop would
> be connected to AC-supply the shutdown would be canceled.

There is a daemon (apmd) that should do that kind of stuff (is there one in
muLinux ?). I know nothing about but have a link

http://www.cut.de/bkr/linux/apmd/apmd.html

But maybe you want something simpler that only look in /proc/apm every
minute, for example. and if the state is critical sends a message to all
consoles and halt in 5 minutes, unless the power came back ?

I don't know at all how to do 2 thinks in that I would like to know, if
someone could tell me :

how to have a process that sleeps for 1 minute and don't take his time slice
during that time ? I think with the sleep command, the process still take
his time slice to recognize it has nothing to do. (I could be wrong here).

The second is how to send a message to all consoles (I think it is possible
via syslog, but it is quite overkill !).

Pat

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: mulinux-help@sunsite.auc.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:15 CET