[opensuse] opensuse 11.3 power down system with apcupsd (solution)



Hi,

I searched for a way to power down my box at a predefined time including
switching off the power from the UPS.

"shutdown -h time" handles the shutdown of the system nicely, but to power
down the UPS some changes have to be done:

/etc/sysconfig/shutdown :
HALT_POWERDOWN_INSERT="/etc/init.d/apcupsd powerdown"

"try-powerdown" will only power down the UPS if it is running on battery at
this time.

The script /etc/init.d/apcupsd from apcupsd-3.14.6-8.1 contains a wrong path
for the apcupsd-lite binary, it should be
APCUPSD_LITE=/sbin/apcupsd-lite
instead of
APCUPSD_LITE=/usr/sbin/apcupsd-lite

Additionally, the action performed in case of "powerdown)" has to be changed:
it should perform action "--power-off" instead of "--killpower".

"--killpower" only takes effect if the UPS is running on battery at this time.

Following patch can apply the changes:

--- apcupsd 2010-07-05 18:34:19.000000000 +0200
+++ apcupsd_my 2010-12-18 12:29:01.741526103 +0100
@@ -26,7 +26,7 @@
### END INIT INFO

APCUPSD=/usr/sbin/apcupsd
-APCUPSD_LITE=/usr/sbin/apcupsd-lite
+APCUPSD_LITE=/sbin/apcupsd-lite
test -x $APCUPSD -o -x $APCUPSD_LITE || exit 5

# Shell functions sourced from /etc/rc.status:
@@ -138,7 +138,7 @@
## Special command: Instruct UPS to shutdown.
sync &
echo -n "Instructing UPS to powerdown "
- $APCUPSD_LITE --killpower >/dev/null 2>&1 || rc_failed
+ $APCUPSD_LITE --power-off >/dev/null 2>&1 || rc_failed
rc_status -v
;;
try-powerdown)




Dieter
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Nut and RAID on FreeBSD 7.0
    ... >> power goes out for more than say 5 minutes or so. ... >> system goes into a safe state when the battery gets low, then the ups ... >> The second question has to do with a rc.d script that nut recommends ... The script does a 'upsdrvctl shutdown' and then a sleep ...
    (freebsd-questions)
  • Re: Nut and RAID on FreeBSD 7.0
    ... > power goes out for more than say 5 minutes or so. ... > system goes into a safe state when the battery gets low, then the ups ... > The second question has to do with a rc.d script that nut recommends ... The script does a 'upsdrvctl shutdown' and then a sleep ...
    (freebsd-questions)
  • Re: Power Policy Questions
    ... How are you setting the shutdown configuration, ... Power or in the software that came with the UPS? ... >I have a server running off of a UPS. ...
    (microsoft.public.windows.server.sbs)
  • Nut and RAID on FreeBSD 7.0
    ... I have a RAID fileserver plugged into a UPS and nut is able to ... power goes out for more than say 5 minutes or so. ... 'shutdown -h +0' which will halt the system. ... The second question has to do with a rc.d script that nut recommends ...
    (freebsd-questions)
  • Re: On UPS monitoring
    ... the UPS takes care of the very short outages (often under three ... My UPS is an APC Back-UPS ES 350; when fully charged, this should power ... But the UPS gave out before the shutdown was complete. ... In my experience, if the battery in your UPS is over about three years old, ...
    (comp.os.linux.setup)