[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

/var/state or /var/lock ? Re: debian & UPS support



Jozef Hitzinger wrote:

> On Tue, 24 Aug 1999, Peter S Galbraith wrote:
>
> > Note that as you halt the machine, the shutdown sequence
> > (/etc/init.d/halt) invokes ups-monitor one last time with the
> > kill flag (-k), forcing the UPS to turn off, but only if the UPS
> > is indeed in either the FAIL or LOW state (in any case, any UPS I
> > know of will ignore the kill signal if power is still available).
> 
> And as I just found out, APC SmartUPS does kill even good line when asked
> to (*sigh*).

My package currently sends the kill signal to the UPS on `halt',
whether the halt is caused by power failure or not (the signal is
ignored on the primary brand of UPSes targetted by my packge).
Nevertheless, since I now know of one UPS that doesn't ignore the
signal, I wonder if if should hack my /etc/init.d scripts to get
around that.  Something like the following:

"power fail" and "battery low" conditions initiate a shutdown and
create a status file somewhere (/var/lock/powstatd or
/var/state/powstatd).  halt calls /etc/init.d/ups-monitor which I
could change such that it only sent out the UPS kill signal if that
file exists (and deletes the file too).

"power ok" deletes the status file (since evreything is okay).

Think it's a good idea?  This would let powstatd work correctly
with UPS unit that don't ignore the kill signal when the power is
on.

What file should I `touch' and then remove?  /var/lock/powstatd or
/var/state/powstatd?

Thanks,
Peter


Reply to: