Summary: | sys-power/apcupsd-3.14.8-r1: apcupsd.powerfail init script runlevel check fails when shutting down | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | parafin <help> |
Component: | Current packages | Assignee: | John Einar Reitan <john.einar> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | base-system, holger, jstein, k_f |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
parafin
2012-05-29 20:19:10 UTC
I have discovered another issue caused by absence of indefinite sleep in apcupsd.powerfail during power failure yesterday. This is what happened: power failed; battery charge level reached defined limit; shutdown was initiated; power returned before system was finished with shutdown cycle; apcupsd.powerfail ran and sent killpower signal to UPS; UPS switched to batteries and started timeout for cutting the power; system shut down completely (did poweroff); timeout was reached and UPS cut the power to the system for a couple of seconds, then returned to normal operation; UPS did The Right Thing (c), but since system was shut down, capacitors in PSU held the voltage for those couple of seconds, so main board didn't notice that power was cut and didn't turn the system on after power returned. So again, besides the broken runlevel check, apcupsd.powerfail must have indefinite (or very long) sleep after calling apcupsd --killpower - both for "return to previous power state" functionality in BIOS to work and to avoid problem I described in this comment. I just experienced two power failures. On the first one, apcupsd correctly initiated system shutdown, but the apcupsd.powerfail script did not issue the killpower command to apcupsd. Mains power returned before the batteries ran all the way down, and so my system did not automatically power back up; I had to start it manually. Shortly later, the power went out again, but this time, apcupsd did issue the killpower command to the UPS, and everything behaved as it should. So there is some degree of non-determinism in whether the runlevel check succeeds. I too have removed the runlevel check since the check for the existence of the powerfail file is sufficient. |