Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 20216 - apcupsd fails to kill APC unit on power loss
Summary: apcupsd fails to kill APC unit on power loss
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major
Assignee: Michael Imhof (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-30 10:50 UTC by John McSwain
Modified: 2003-12-04 16:29 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John McSwain 2003-04-30 10:50:45 UTC
Using the serial interface Apcups should first shutdown the system (which it 
does) then kill the power to the APC UPS (which the Gentoo implementation does 
NOT do).  In LFS I have made a script which run right before sytem halt which 
does this.  RH and others modify the halt script.  In Gentoo I don't fully 
understand the shutdown sequence to know what to modify.  The problem is sever 
on remote servers that will NOT come back on line after a power loss but need 
operator attention.

Reproducible: Always
Steps to Reproduce:
1.Emerge apcups on a Gentoo system
2.Have a APC Ups connected via the serial cable and /etc/apcupsd/apcusd.conf 
properly configured
3. Disconnect the UPS from the power source 

Actual Results:  
The sytem shutdowns properly to the "Power Down" state.  Power continues to the 
APC UPS system.  When power returns the system remains in the "Power Down" 
state.

Expected Results:  
After sytem reaches the "Power Down" state and a delay of about 60 seconds the 
killpower command should be sent to the APC UPS.  When input power is restored 
to the UPS the sytem should power back up. 

The details of apcupsd operation and how it works on other OS can be found in 
the Apcupsd Manual:

http://www.sibbald.com/apcupsd/manual/index.html
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2003-04-30 21:25:21 UTC
Hi there. Can you attach that LFS script and I'll see what I can do (yes, drobbins just got an APC UPS) :)
Comment 2 Sylvain Demers 2003-07-27 11:15:49 UTC
Until this bug is fixed, I just tried a workaround.  Add these 4 lines to your 
/etc/local.stop file: 
 
if [ -f /etc/apcupsd/powerfail ] ; then 
    echo "Powering off UPS..." 
    /etc/apcupsd/apccontrol killpower 
fi 
 
The killpower command takes a few seconds to execute, so I'm not sure a 20 
seconds grace period would be enough to let the system shutdown completely. 
 
Comment 3 Martin Holzer (RETIRED) gentoo-dev 2003-09-03 11:41:13 UTC
see also bug #25962 
Comment 4 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-04 13:04:10 UTC
this is already/now in /etc/init.d/halt :)
Comment 5 Michael Imhof (RETIRED) gentoo-dev 2003-12-04 16:29:34 UTC
wow, that's great, thanks