backupsd is an ultra-simple daemon to handle emergency shutdown of a NetBSD system when a connected APC Back-UPS signals a power failure. This is an ongoing project; suggestions, bugfixes, and additional code are appreciated.
Right now, this program performs an ultra-messy shutdown of NetBSD. This has to get more elegant in the future, if it's going to be properly useful. This is my first attempt at writing any sort of program that has to work closely with NetBSD, and as such, it's probably wrong. Hopefully this wrongness will eventually be corrected.
Maybe I'll design some hardware to delay the poweroff signal. That would make shutdown quite a bit easier.
The UPS also emits a low battery signal, but at TTL (not RS-232) levels, that I'd like to use. Also, somehow, APC's PowerChute software detects if a Back-UPS is connected. I wonder how that works.
My shutdown cable looks like this: (a subset APC's):
DB9 Female (serial end) DB9 Male (UPS end)
GND 5 ----------------------------- 4 GND
CTS 8 <---------------------------- 2 Line Fail
DTR 4 ----------------------------> 1 Shutdown
Build it, or feel free to buy APC's.
UPDATE: Quite a while ago, Dave Angus sent me this email about what's inside the cable. I apologize for not posting it before now.
License: Public Domain (no GPL virus)
Archived:
$Id: index.html,v 1.8 2001/05/30 13:55:36 dfraser Exp $Dan J. Fraser (dfraser@mother.com)