Path: utzoo!attcan!uunet!ncc!lyndon
From: lyndon@ncc.Nexus.CA (Lyndon Nerenberg)
Newsgroups: comp.sys.misc
Subject: Re: Protecting computer equipment
Message-ID: <10310@ncc.Nexus.CA>
Date: 5 Jul 88 04:48:00 GMT
References: <1188@gmu90x.UUCP> <178@kesmai.COM>
Reply-To: lyndon@ncc.UUCP (Lyndon Nerenberg)
Organization: Nexus Computing Inc.
Lines: 27

In article <178@kesmai.COM> dca@kesmai.COM (David C. Albrecht) writes:
>In article <1188@gmu90x.UUCP>, dana@gmu90x.UUCP (J Dana Eckart) writes:

>> In the case of UPS, if commercial
>> power goes out, is it possible to automatically signal the computer 
>> to do initiate system shutdown while battery power is still available?

>All that text and I left something out.  Some UPSen provide a relay which
>will close when the UPS is getting near the end of its power supply.
>You have to wire a connector that will interface to a port on your equipment
>and have some process monitoring that port and recognise when the relay
>switches.  i.e. it can be done but it usually isn't pretty.

Actually, it's quite trivial.

Have the relay switch the appropriate voltage onto the Carrier Detect
pin of an unused serial port on the system when the batteries are
getting low.

At boot time, start a process that does a blocking open on the port.

When the relay closes, CD is asserted, causing the open call to
unblock and return. From that point, have the program initiate
a shutdown sequence.

-- 
{alberta,pyramid,uunet}!ncc!lyndon  lyndon@Nexus.CA