UPS directed system shutdown info needed

Jonathan Bayer jbayer at ispi.UUCP
Mon Jan 30 03:58:31 AEST 1989


In article <210 at wa3wbu.UUCP> john at wa3wbu.UUCP (John Gayman) writes:
>
>    Does anyone have experience with interfacing a small UPS system (600-
>1000VA) to a 386-based Unix box to allow for orderly system shutdown
>when the batteries run down ?
>

The UPSs I have worked with usually have an open/close switch.  In other
words, the switch is usually open, but closes when the power goes away. 
It could also be the other way around.

What you want to do is to create a background daemon which will poll a
serial port.  The serial port will be hooked up to the ups, switching
open the td and rd lines.  In the case of the normally open switch, if
the deamon is able to send a character out the port, and get it back, it
will know that power has failed. In the case of the normally closed
switch, when it fails to receive the character back it will know that
power has failed.

The daemon should poll at least once every two minutes (depending on the
capacity of the UPS).  When it detects a power failure it should notify
all users that a system shutdown due to power failure is imminent, and
start keeping time.  If the power does not come back within a specified
period of time, the daemon will do an orderly system shutdown.


JB


-- 
Jonathan Bayer			      Beware: The light at the end of the
Intelligent Software Products, Inc.	      tunnel may be an oncoming dragon
19 Virginia Ave.				...uunet!ispi!jbayer
Rockville Centre, NY 11570  (516) 766-2867    jbayer at ispi



More information about the Comp.unix.questions mailing list