Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46440 - UPS power not killed in shutdown when using apcupsd
Summary: UPS power not killed in shutdown when using apcupsd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-31 21:26 UTC by Lee Weisz
Modified: 2005-02-10 21:57 UTC (History)
6 users (show)

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


Attachments
Makes halt.sh configurable for NUT and apcupsd systems (halt.sh.patch,1.47 KB, patch)
2004-03-31 21:33 UTC, Lee Weisz
Details | Diff
Improved patch, autodetects nut or apcupsd (halt.sh.patch,1.09 KB, patch)
2004-08-12 16:29 UTC, Remy Blank
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lee Weisz 2004-03-31 21:26:27 UTC
In a battery exhausted shutdown situation the computer should signal the UPS to kill the power when it has safely shutdown.

Reproducible: Always
Steps to Reproduce:
1. Kill the UPS power
2. Computer runs on batteries until signalled to shutdown.
3.

Actual Results:  
Computer shuts down, but UPS never kills power

Expected Results:  
UPS should kill power.

apcupsd uses /etc/init.d/halt script to kill power. The latest releases ignore
this script and call /etc/init.d/halt.sh instead. /etc/init.d/halt.sh only knows
how to shutdown NUT based UPS systems.
Comment 1 Lee Weisz 2004-03-31 21:33:11 UTC
Created attachment 28487 [details, diff]
Makes halt.sh configurable for NUT and apcupsd systems

The attached patch will modify the halt.sh script to allow the UPS killpower
function to be configured for either system. Luckily both systems are very
similar. There are three fields at the top of the resultant script for setting
the killpower parameters. It should work for NUT, but I don't know since I
don't use that system. There's probably a better place for these parameters,
rc.conf perhaps?
Comment 2 Martin Holzer (RETIRED) gentoo-dev 2004-04-21 14:12:28 UTC
which version of acpupsd ?
Comment 3 Lee Weisz 2004-04-21 14:31:25 UTC
I've checked 3.10.9, 3.10.10, 3.10.12. The problem isn't with apcupsd so much as with halt.sh.
Comment 4 Remy Blank 2004-08-12 16:29:32 UTC
Created attachment 37319 [details, diff]
Improved patch, autodetects nut or apcupsd

I improved the first patch so that it autodetects if the power fail event was
generated by nut or apcupsd, and acts accordingly.

Tested with:
baselayout-1.9.4-r3
apcupsd-3.10.10-r2

I still have a problem with the power kill, because my UPS uses USB, I run
udev, and it seems that /dev is unmounted before trying to kill the power. But
that's not related to this bug.
Comment 5 Michael Imhof (RETIRED) gentoo-dev 2004-12-01 14:43:00 UTC
I don't know if I'm the right person to do changes to baselayout.
I think someone more familiar with baselayout should use the provided fixes to improve /etc/init.d/halt.sh.
I'll then remove /etc/init.d/halt from the apcupsd ebuild.
Comment 6 SpanKY gentoo-dev 2005-02-10 21:57:59 UTC
added to cvs, thanks