Path: utzoo!utgpu!watserv1!watmath!att!pacbell!pacbell.com!mips!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!uniwa!DIALix!bernie From: bernie@DIALix.oz.au (Bernd Felsche) Newsgroups: comp.sys.misc Subject: Re: Auto shutdown (on power down) box Summary: use the computer Keywords: UPS power shutdown unix epoch Message-ID: <562@DIALix.UUCP> Date: 9 Sep 90 11:29:34 GMT Expires: 30 Sep 90 00:00:00 GMT References: <1990Sep7.174211@curly.Viewlogic.COM> Reply-To: bernie@DIALix.oz.au (Bernd Felsche) Organization: DIALix Services, Perth Western Australia Lines: 41 In article <1990Sep7.174211@curly.Viewlogic.COM> alan@curly.Viewlogic.COM (Alan Medsker) writes: >I've got an Epoch-1 Infinitestorage NFS server, and a UPS that it runs >off of. I'd like to find a way to have the server shut down >gracefully unattended when the power has been down for x minutes. > >I need an external box of some sort, no doubt, either driven by the >contacts on the UPS (Clary) or just by the presence of power at an >outlet. > >I'm thinking of a box that sends a programmable set of character >strings to an RS-232 port when the power goes down, and one or >two settable periods after the power goes down, and when the power >is restored. > >Any ideas? > Yup: Use the computer. If the UPS has a normally closed (mains available contact) then all you need to do is to hook up a serial cable to spare port on your computer. You can check the mains directly, by getting a relay which has a mains-rated coil, and connecting that to a power point. I think that you can find a cheap plug-pack-type enclosure to stuff this into, making a tidy installation. The contacts merely connect the RX and TX lines, so that when the computer send a character, it will be echo'd back, if mains is available. Net hardware cost <$10! Some implementations may use DCD instead, but modem support is not always available. Now that I've told you, it's obvious, isn't it? Some software on the machine periodically spits out a byte and listens for it. Software could also time the power outage and estimate how serious the problem is. Another nicety would be to abort shutdown if power returns and has stabilised. You can prototype the software as a script, which is usually good enough as you'd only have to check once a minute, don't you? bernie