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

Re: debian & UPS support

Sorry for crossposting, but there was little respons on deb-mentors.

On Tue, 24 Aug 1999, Peter S Galbraith wrote:
> Jozef Hitzinger wrote:
> > Can somebody point me to info on how debian cooperates with UPS? (rtfm is
> > ok) I'd also welcome response from the person who takes care of debian
> > <-> ups functionality (if there is one).
> I'd like to know, if such a person exists.

> > When the battery power gets low, system has to go down, and just before
> > halt a power-off command to the ups should be issued. That means modifying
> > rc scripts, so I wonder if there is some universal policy, or every ups
> > package just does it on its own.
> > 
> > I'm curious because the standard rc0.d/S90halt script refers to ups:
> > 
> > #! /bin/sh
> > # halt          Execute the halt command.
> > # Version:      @(#)halt  2.75  19-May-1998  miquels@cistron.nl
> > PATH=/sbin:/bin:/usr/sbin:/usr/bin
> > # See if we need to cut the power.
> > if [ -x /etc/init.d/ups-monitor ]
> > then
> >         /etc/init.d/ups-monitor poweroff
> > fi
> > halt -d -f -i -p
> I'm finishing up packaging powstatd (a configurable dumb-mode UPS
> monitor that works out of the box with Cyber Power Systems
> UPSes).

Smartupstools support APC, PowerCom, Fenton Technologies, Opti-UPS,
& Upsonic. Last three are now being tested, it's likely that other brands
will be added.
> Here's what I figured out (please correct me if I'm wrong).  
>  - Have your package provide and conflict with "ups-monitor"

and with other ups packages too, I presume

>  - provide a symlink such that /etc/init.d/ups-monitor points to
>    your /etc/init.d/smartupstools script.  This script should
>    accept the "poweroff" argument to send the kill signal to the
>    UPS on system halt.

means that 'ups-monitor' is just hardcoded into halt script? ok, I can
mimic it's behavior, but .. hmm, I didn't find anything about this in the
policy. please give me a pointer if it's just my blindness

> Unrelated, but extra info: My package also has a
> /etc/init.d/powerfail script.  This script is the one called by
> init (as configured by /etc/inittab) and should accept the
> arguments "start", "stop" and "now":
> - `/etc/init.d/powerfail start' initiates a timed "shutdown -h"
>   (halt) in background, on the assumption that if power is
>   restored the shutdown can be cancelled.
> - `/etc/init.d/powerfail stop' cancels the running shutdown and
>   notifies all users that power is restored and no shutdown is
>   imminent.
> - `/etc/init.d/powerfail now' cancels the running shutdown and
>   initiates an immediate "shutdown -h" in foreground; this means
>   once the UPS tells you the battery is low, you will indeed
>   shutdown (there is no recovery).
> 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).

I probably won't need something like this .. If the line is good,
there's no reason to shutdown the ups, if the power failed, shutdown will
be triggered when battery gets low. 

And as I just found out, APC SmartUPS does kill even good line when asked
to (*sigh*).

jozef  :-)  
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!

Reply to: