Friday, January 19, 2007

Automated shutdown on power failure - Trial by fire

I installed apcupsd last year. I tested it through to see that all power states are properly recognized, but never did a full power down test to make sure that the system shuts down when battery power runs low. Today we lost power for over 1 1/2 hours and it worked just perfectly:

Jan 19 07:00:02 chef syslogd: restart
Jan 19 14:11:34 chef apcupsd[26943]: Power failure.
Jan 19 14:11:40 chef apcupsd[26943]: Running on UPS batteries.
Jan 19 15:11:21 chef apcupsd[26943]: Battery charge below low limit.
Jan 19 15:11:21 chef apcupsd[26943]: Initiating system shutdown!
Jan 19 15:11:21 chef apcupsd[26943]: User logins prohibited
Jan 19 15:11:21 chef apcupsd[26943]: Attempting to kill the UPS power!
Jan 19 15:11:24 chef syslogd: exiting on signal 15
Jan 19 15:34:48 chef syslogd: restart
Jan 19 15:34:48 chef /bsd: OpenBSD 3.8-stable (RAID) #1: Thu Apr 20 21:55:59 PDT 2006
Jan 19 15:34:48 chef /bsd: root@chef.lostentry.org:/usr/src/sys/arch/i386/compile/RAID


Battery started running low after an hour, and apcupsd initiated a clean system shutdown. When the power returned the server rebooted just fine and went merrily on its way. Neat.

No comments: