APCUPSD: Difference between revisions

From VVCWiki
Jump to navigationJump to search
No edit summary
 
(No difference)

Latest revision as of 21:10, 21 November 2009

Automatic server recovery with APCUPSD

  • Setup BIOS to recover "LAST" power state
  • Make OS to halt on power loss
/etc/apcupsd/doshutdown
#!/bin/sh

/sbin/shutdown -h -H now "apcupsd UPS ${1} initiated shutdown"

exit 99
  • If UPS supports it, power-off UPS, so if power returns before battery is completely exhausted, UPS and the server will get restarted.
/sbin/halt.local
#!/bin/sh

# See if this is a powerfail situation.
if [ -f /etc/apcupsd/powerfail ]; then
echo
echo "APCUPSD will now power off the UPS"
echo
/etc/apcupsd/apccontrol killpower
fi