Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!purdue!decwrl!hplabs!hp-sdd!ucsdhub!isg100!elgar!ag From: ag@elgar.UUCP (Keith Gabryelski) Newsgroups: comp.unix.questions Subject: Re: UPS directed system shutdown info needed Message-ID: <60@elgar.UUCP> Date: 4 Feb 89 05:25:30 GMT References: <210@wa3wbu.UUCP> <431@ispi.UUCP> <10170@drutx.ATT.COM> Reply-To: ag@elgar.UUCP (Keith Gabryelski) Organization: Elgar Corporation, San Diego, CA Lines: 41 In article <10170@drutx.ATT.COM> blum@drutx.ATT.COM (Mark Blumhardt) writes: >In article <431@ispi.UUCP>, jbayer@ispi.UUCP (Jonathan Bayer) writes: >> In article <210@wa3wbu.UUCP> john@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 ? >> > >> 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... > >Another way, which may use less resources is to...hook the serial port to >the UPS, and connect (I cant remember exactly) ground and DTR. Exec a >process that tries to open the port. It will block (or return), depending >on the state of the contact closure. After the return you can do a >graceful shutdown. Yes, as I had pointed out earlier, this is infact how Elgar's UniSafe product works. I think Jonathan was talking about a fault tolerant way of handling the communications on a possibly faulty serial device (one which may hang). Actually, the first demo I gave of UniSafe was basicly: cat /dev/null >/dev/ttya # When this returns, we are on battery power wall << THEEND We're on battery power. Going down in 1 minute. THEEND sleep 60 # One minute /etc/shutdown 0 # See Ya! This is ofcourse simplistic; you'd never want to wait just one minute and you'd definitely want to test for short term power failures, but it does the job. Pax, Keith -- ag@elgar.CTS.COM Keith Gabryelski ...!{ucsd, crash}!elgar!ag