I'm running an APC UPS on Gentoo linux (Back-UPS XS 1300G). Up till now, I've used the UPS in "dumb" mode; i.e. no acpusd running. My main concern has been short power blips, and under/over-voltage. All I wanted was a few minutes to shut down or hibernate the PC before the battery gave out. I've enabled the "Master/Controlled outlets" feature. I have the PC plugged into the Master, and a surgeprotector powerbar into a Controlled outlet. The monitor/speakers/modem/etc are plugged into the surgeprotector. When I manually hibernate the PC, the ups cuts off power to the peripherals connected to the surgeprotector (connected to the "Controlled outlet").
I may be getting a contract soon that involves crunching huge text files, with multi-hour overnight data runs, etc. I'll launch a run, and leave things unattended for hours on end. Let's assume I start a run, go away for the day, and a power outage hits. My Google searches always seem to turn up hits involving sending warning messages to users that the system may be going down soon. What I actually want to happen in an extended power outage is... * have the system execute the command "/usr/sbin/hibernate" to save program state, etc to disk, and then shut down. * shut down the APC ups afterwards. Note that once "/usr/sbin/hibernate" is launched, you have to assume that the ups immediately loses contact with the PC, ***BUT THE UPS MUST STAY ON FOR A COUPLE OF MINUTES AFTERWARD*** to give the PC time to shut down gracefully. Will "KILLDELAY 180" give 3 minutes safety margin? And what do I have to do to get it to execute "/usr/sbin/hibernate"? As per instructions from the install, I've done... rc-update add apcupsd.powerfail shutdown ...which is supposed to tell the ups to shut down when the PC shuts down. Colour me confused... * does the ups not shut itself down due to BATTERYLEVEL/MINUTES/TIMEOUT? * if so, why does it need the "apcupsd.powerfail" service in my PC's shutdown runlevel? Here are my config file and apcaccess status output... *** /etc/apcupsd/apcupsd.conf file *** UPSCABLE usb UPSTYPE usb LOCKFILE /var/lock SCRIPTDIR /etc/apcupsd PWRFAILDIR /etc/apcupsd NOLOGINDIR /etc ONBATTERYDELAY 6 BATTERYLEVEL 15 MINUTES 5 TIMEOUT 0 ANNOY 300 ANNOYDELAY 60 NOLOGON disable KILLDELAY 180 NETSERVER on NISIP 0.0.0.0 NISPORT 3551 EVENTSFILE /var/log/apcupsd.events EVENTSFILEMAX 10 UPSCLASS standalone UPSMODE disable STATTIME 0 STATFILE /var/log/apcupsd.status LOGSTATS off DATATIME 0 *** apcaccess status *** APC : 001,037,0914 DATE : 2013-01-13 03:17:56 -0500 HOSTNAME : d531 VERSION : 3.14.8 (16 January 2010) gentoo UPSNAME : d531 CABLE : USB Cable MODEL : Back-UPS XS 1300G UPSMODE : Stand Alone STARTTIME: 2013-01-13 03:15:05 -0500 STATUS : ONLINE LINEV : 122.0 Volts LOADPCT : 7.0 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 60.0 Minutes MBATTCHG : 15 Percent MINTIMEL : 5 Minutes MAXTIME : 0 Seconds SENSE : High LOTRANS : 088.0 Volts HITRANS : 136.0 Volts ALARMDEL : Always BATTV : 27.2 Volts LASTXFER : No transfers since turnon NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : NO STATFLAG : 0x07000008 Status Flag MANDATE : 2012-07-06 SERIALNO : [ deleted ] BATTDATE : 2012-07-06 NOMINV : 120 Volts NOMBATTV : 24.0 Volts NOMPOWER : 780 Watts FIRMWARE : 864.L6 .D USB FW:L6 APCMODEL : Back-UPS XS 1300G END APC : 2013-01-13 03:17:56 -0500 -- Walter Dnes <[email protected]> I don't run "desktop environments"; I run useful applications

