Bug 840331 - apcupsd does not poweroff computer
Summary: apcupsd does not poweroff computer
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: apcupsd
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-15 23:11 UTC by Germano Massullo
Modified: 2012-12-07 13:04 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-07 12:24:33 UTC


Attachments (Terms of Use)
/var/log/messages about this period of time (1.27 KB, text/plain)
2012-07-15 23:11 UTC, Germano Massullo
no flags Details

Description Germano Massullo 2012-07-15 23:11:08 UTC
Created attachment 598340 [details]
/var/log/messages about this period of time

Description of problem:
While the UPS is running on batteries, and apcupsd tells the computer to poweroff, you can see only a halt procedure, but the computer is still turned on, so it does not poweroff.

Version-Release number of selected component (if applicable):
Version     : 3.14.10
Rilase     : 4.fc17

Steps to Reproduce:
1. edit the /etc/apc/apcupsd.conf
2. look for "TIMEOUT" and put 15 as value
3. save, then on bash do: systemctl restart apcupsd.service
4. unplug power cable and wait for computer auto power off
  
Actual results:
the computer completes the halt procedure doing all umount, etc. but does not poweroff

Expected results:
switch off computer power at the end of halting process

Additional info:
kernel 3.4.4-5.fc17.x86_64 (but this info is useless since I remember this happening by years)

Comment 1 Michal Hlavinka 2012-07-26 12:20:47 UTC
do you have selinux enabled?

Comment 2 Germano Massullo 2012-07-26 12:21:34 UTC
Yes I have SELinux enabled

Comment 3 Michal Hlavinka 2012-11-05 16:53:57 UTC
I tried to reproduce this, but it was working fine. After unplugging the cable (and configured time) apcupsd reported power failure. After next 15 seconds configured in TIMEOUT, it started power down. System terminated after about 4 seconds and 30 seconds later, ups turned power off. It was working with both selinux disabled and enabled.

If it still does not work for you, try to reproduce this with selinux in permissive mode - execute
setenforce 0
as root (the change is only temporal - until reboot).

If you see "system halted" in console and no apcupsd error (it won't be in log, because logging is already stopped), then you ups got its power off command.

Check if your ups works correctly with:
apcupsd --killpower
It'll power off yor ups, so close all applications before executing this command.

Comment 4 Germano Massullo 2012-12-06 19:57:14 UTC
Unfortunately the BR800I has broken, so it is no longer possible to test this problem with the old UPS.
Now I have a BR900GI and, after 15 seconds on battery mode, the computer starts the halt procedure till the moment you can see "system halted" on the screen, then the UPS switches off the power. So everything is okay.

My question is: why the computer does not poweroffs itself and it must be the UPS to switch off the power? Shouldn't be something like: system poweroffs and then the UPS poweroffs too? I remember APC powerchute on Windows let the computer poweroff

Comment 5 Michal Hlavinka 2012-12-07 12:24:33 UTC
(In reply to comment #4)
> My question is: why the computer does not poweroffs itself and it must be
> the UPS to switch off the power? Shouldn't be something like: system
> poweroffs and then the UPS poweroffs too? I remember APC powerchute on
> Windows let the computer poweroff

It's because you want to power on the computer once power outage is over. Usually you have set "keep last state" in your BIOS, which means that when you power off your computer, it won't power on automatically later. You need your computer to have lost power by turning the ups off.

-----------

> Now I have a BR900GI and, after 15 seconds on battery mode, the computer
> starts the halt procedure till the moment you can see "system halted" on the
> screen, then the UPS switches off the power. So everything is okay.

OK, closing this bug. If someone still has this problem, feel free to reopen.

Comment 6 Germano Massullo 2012-12-07 13:04:05 UTC
Thank you for the explanation


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