Bug 348701 - apcupsd control script does not invoke shutdown properly
Summary: apcupsd control script does not invoke shutdown properly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: apcupsd
Version: 7
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Tomas Smetana
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-10-23 12:31 UTC by Daphne Shaw
Modified: 2008-02-14 14:20 UTC (History)
1 user (show)

Fixed In Version: 3.14.2-2.fc8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-02-14 14:16:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
A patch for apccontrol to fix Fedora shutdown (415 bytes, patch)
2007-10-23 12:31 UTC, Daphne Shaw
no flags Details | Diff
/sbin/halt.local (480 bytes, text/plain)
2008-02-14 13:42 UTC, Vadym Chepkov
no flags Details

Description Daphne Shaw 2007-10-23 12:31:21 UTC
Description of problem:

When shutting down, the apcupsd control script needs to call shutdown in such a
way that the machine halts rather than powers off.  On Fedora, "shutdown -h"
does a poweroff by default.  This should be "shutdown -h -H" for the proper halt
behavior.

Version-Release number of selected component (if applicable):

apcupsd-3.14.2-1.fc7

Steps to Reproduce:
1. Cause a power failure when using apcupsd
2. See that the machine powers off

Additional info:

See also bug 346261 and bug 346271.

I've attached a patch.

Comment 1 Daphne Shaw 2007-10-23 12:31:21 UTC
Created attachment 235031 [details]
A patch for apccontrol to fix Fedora shutdown

Comment 2 Tomas Smetana 2008-01-16 13:03:09 UTC
When there is a power outage and apcupsd decides to shutdown the machine, what
is the reason not to power it off?  The machine can automatically power on again
when the outage is over or whatever an user sets it up.  I don't understand what
is the benefit of halting the machine when there is no power.

Maybe you can explain the reason.

Comment 3 Daphne Shaw 2008-01-16 14:50:39 UTC
The problem is that there are some systems that try and restore the last
known power state after a power failure, so if the machine was powered on, it
comes back on, and if the machine was powered off, it stays off.   For a UPS to
be be meaningful, the machine must come back on again when the power is restored.

The patch forces the machine to be in halt state (but still powered on) when the
UPS cuts the power, so when the system returns to the last known power state, that
state is "on".


Comment 4 Tomas Smetana 2008-01-30 11:32:09 UTC
This makes sense.  Thanks.  Your patch will be present in the next release.

Comment 5 Fedora Update System 2008-01-30 13:32:39 UTC
apcupsd-3.14.2-2.fc8 has been submitted as an update for Fedora 8

Comment 6 Fedora Update System 2008-01-30 13:40:55 UTC
apcupsd-3.14.2-2.fc7 has been submitted as an update for Fedora 7

Comment 7 Fedora Update System 2008-02-02 08:58:25 UTC
apcupsd-3.14.2-2.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update apcupsd'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F7/FEDORA-2008-1233

Comment 8 Fedora Update System 2008-02-13 05:06:09 UTC
apcupsd-3.14.2-2.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2008-02-13 05:09:49 UTC
apcupsd-3.14.2-2.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Vadym Chepkov 2008-02-14 13:42:41 UTC
Created attachment 294910 [details]
/sbin/halt.local

Comment 11 Vadym Chepkov 2008-02-14 13:44:46 UTC
There is another scenario that is not handled properly. In case power returns 
after system halted but before UPS ran out of battery system will be never 
restarted. UPS should be powered off during shutdown. /etc/init.d/halt does 
that for nut package but not for apcupsd. I attached my /sbin/halt.local to fix 
the issue, maybe somebody can insert it into a main tree

Comment 12 Tomas Smetana 2008-02-14 13:57:45 UTC
Thank you Vadym.  Maybe it would be better to try to shutdown the UPS from the
halt init script (not the halt.local) as we do with nut -- we'd avoid the
remounting of /usr for instance and we won't have to workaround already existing
halt.local, etc.

Reopening.

Comment 13 Daphne Shaw 2008-02-14 14:04:53 UTC
I believe Vadym's issue is already open as bug 346271.

Comment 14 Tomas Smetana 2008-02-14 14:16:37 UTC
(In reply to comment #13)
> I believe Vadym's issue is already open as bug 346271.

There's no fun in being a package maintainer when users do all the work for
me... I've added myself to cc: of the bug you filled and I'm closing this one
again.  Thank you.

Comment 15 Daphne Shaw 2008-02-14 14:20:40 UTC
To be clearer, UPS shutdown situation using apcupsd needs three bugs to be
fixed before it works: bug 348701 (this one, now fixed), bug 346271 (an issue
with the halt initscript, as noted by Yaydm), and finally bug 346261 (another
halt initscript issue, where the script powers off rather than halting.



Note You need to log in before you can comment on or make changes to this bug.