apcupsd and systemd - killpower issues

Catching up on systemd …

Another possibility (may be more simple) is to place command/script into /lib/systemd/system-shutdown directory. Scripts there are executed at the very last stage, when everything is unmounted (except root).

I appreciate if people could test updated apcupsd package. It adds native systemd shutdown script that is executed late, after everything is unmounted. If you will test it, please disable any custom systemd unit that does the same before. Package is available from here:

bor@opensuse:~> zypper ar obs://home:arvidjaar:bnc785701/openSUSE_12.2_Update bnc785701
bor@opensuse:~> LC_ALL=C zypper search -r bnc785701 -s
Loading repository data...
Reading installed packages...

S | Name                  | Type       | Version       | Arch   | Repository
--+-----------------------+------------+---------------+--------+-----------
i | apcupsd               | package    | 3.14.8-17.7.1 | x86_64 | bnc785701 
v | apcupsd               | package    | 3.14.8-17.7.1 | i586   | bnc785701 
  | apcupsd               | srcpackage | 3.14.8-17.7.1 | noarch | bnc785701 
  | apcupsd-debuginfo     | package    | 3.14.8-17.7.1 | x86_64 | bnc785701 
  | apcupsd-debuginfo     | package    | 3.14.8-17.7.1 | i586   | bnc785701 
  | apcupsd-debugsource   | package    | 3.14.8-17.7.1 | x86_64 | bnc785701 
  | apcupsd-debugsource   | package    | 3.14.8-17.7.1 | i586   | bnc785701 
  | apcupsd-gui           | package    | 3.14.8-17.7.1 | x86_64 | bnc785701 
  | apcupsd-gui           | package    | 3.14.8-17.7.1 | i586   | bnc785701 
  | apcupsd-gui-debuginfo | package    | 3.14.8-17.7.1 | x86_64 | bnc785701 
  | apcupsd-gui-debuginfo | package    | 3.14.8-17.7.1 | i586   | bnc785701
bor@opensuse:~> LC_ALL=C ll /lib/systemd/system-shutdown/
total 8
-rwxr-xr-x 1 root root 182 Nov  7 21:40 apcupsd.shutdown
-rwxr-xr-x 1 root root 154 Oct  5 14:40 mdadm.shutdown

If someone can test nut, I will build package for it as well.

Thank you.

I have more than one APC UPS and would like to help test. Consider that I do little more that install and configure the application. That includes editing the config file for usb in my case, start the service and auto load the GUI application into my system tray. But I really don’t do much else. If I find that a power failure has occurred, I look back to see when it all happened. A few months ago, the UPS on my entertainment system showed the UPS battery had went bad and I found my other computers all were off. After looking through the logs, I found out the start of the power failure and how long each PC ran before they shut down. A analog clock allowed me to determine how long the power failure had really been off oddly and it was over two hours one weekday. Anyway, if you have a pointer to the updated files and what you want to be done, just let me know what it is.

Thank You,

Updated package is in repo I mentioned. It is for 12.2; I do not know whether systemd in 12.1 supported system-shutdown directory already. So make sure you are using systemd and not sysvinit :slight_smile: ; add repo and install apcupsd from it:

zypper ar obs://home:arvidjaar:bnc785701/openSUSE_12.2_Update bnc785701
zypper install -r bnc785701 -f apcupsd

configure apcupsd to switch UPS off on power failure and test what happens when you unplug power from UPS. If it does not work you may want to remove redirection to /dev/null in /lib/systemd/system-shutdown/apcupsd.shutdown to see what it says. I just did copy’n’paste from initscript including redirections.