The /etc/init.d/halt script installed by apcupsd performs a two minute wait and exit 1 after issuing the killpower command to the UPS. This essentially means the final halt command isn't executed under powerfail conditions and software RAID superblocks won't be updated. As a member of the apcupsd development team, I've had to report this bug on every distribution I've used. The apcupsd project no longer advocates the wait and exit 1 under powerfail conditions because of the problems it causes. Reproducible: Always Steps to Reproduce: 1. 2. 3.
So what are you recommending /etc/init.d/halt does instead ?
/etc/init.d/halt should do the following: 1) Issue apcupsd --killpower 2) Terminate as it normally would The RAID superblocks will be updated and the system will do whatever it should for a halt condition i.e. display "Power down" or power itself off. The UPS will power itself off after its configured KILLDELAY setting expires. The apcupsd documentation (which has been recently revised) discusses powerdown situations and configuration for powerdown in detail. Regards, Neil Darlow
During the conversion of my system to UTF-8, I upgraded baselayout from 1.9.4 to 1.11.11 and noticed that /etc/init.d/halt.sh in the newer version does exactly what I described for apcupsd during halt. In fact, I can't see that /etc/init.d/halt is actually executed as part of the halt process (correct me if I'm wrong). Regards, Neil Darlow
i dont have an /etc/init.d/halt on my system ... or any of my systems ... they're all /etc/init.d/halt.sh
actually i lied, i managed to find 1 system which had it ... it isnt part of baselayout and is never executed by baselayout so if halt.sh (which is part of baselayout) does the right thing, can we punt this bug ?
Looks like /etc/init.d/halt is installed by apcupsd (and should be removed). Somewhere after baselayout-1.9.4, support for apcupsd was added to /etc/init.d/halt.sh so systems running that version won't turn the UPS off. Either some backporting, or some effort made to get the appropriate newer version of baselayout marked stable, is required. Regards, Neil Darlow
does apcupsd still install /etc/init.d/halt ? if so, we should fix the package
apcupsd no longer installs /etc/init.d/halt