How do I set up UPS to hibernate under apcupsd?

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Mon Jan 28 21:48:55 UTC 2013


  OK, I've gone and bought an APC UPS, and installed apcupsd.  The man
pages and Google are full of examples of sending warnings to users and
eventually shutting down when the battery is running low during a power
outage.

  What I have *NOT* been able to find is simple instructions on how to
hibernate the system during a power outage.  The apcupsd mailing list
has been useless.  What I need to accomplish is...
1) First; order the UPS to shutdown after a specified delay
2) Second; immediately after sending the first order, execute
   /usr/bin/hibernate so that the PC powers down within the delay period

***IMPORTANT*** Once /usr/hibernate is launched, you must assume that
the apcupsd process is being, or has been, frozen and is no longer in
charge.  This goes counter to the apcupsd man page which assumes that
the apcupsd process is in charge until the very end.  The UPS itself
must finish the shutdown, after the specified delay.  I also don't want
apcupsd, after being woken up, to "continue the shutdown", and shutdown
again.  Anybody have this working?


Output from
grep -v ^# /etc/apcupsd/apcupsd.conf | grep ^...

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

Output from apcaccess

APC      : 001,039,1024
DATE     : 2013-01-28 16:11:18 -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    : 121.0 Volts
LOADPCT  :   6.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  64.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 : Unacceptable line voltage changes
NUMXFERS : 1
XONBATT  : 2013-01-25 15:53:09 -0500  
TONBATT  : 0 seconds
CUMONBATT: 8 seconds
XOFFBATT : 2013-01-25 15:53:17 -0500  
LASTSTEST: 2013-01-25 15:53:09 -0500  
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
MANDATE  : 2012-07-06
SERIALNO : ************  
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-28 16:11:51 -0500

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
I don't run "desktop environments"; I run useful applications
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list