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.
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?
which version of acpupsd ?
I've checked 3.10.9, 3.10.10, 3.10.12. The problem isn't with apcupsd so much as with halt.sh.
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.
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.
added to cvs, thanks