mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-25 10:03:03 +01:00
55 lines
1.8 KiB
Text
55 lines
1.8 KiB
Text
README-SLACKWARE
|
|
Written by Robby Workman <rworkman@slackbuilds.org>
|
|
|
|
You'll need to start the apcupsd service at boot.
|
|
The recommended way is to add the following to your /etc/rc.d/rc.local
|
|
script:
|
|
|
|
if [ -x /etc/rc.d/rc.apcupsd ]; then
|
|
/etc/rc.d/rc.apcupsd start
|
|
fi
|
|
|
|
Make sure the rc.apcupsd script is executable.
|
|
|
|
|
|
Finally, you'll need to edit your /etc/rc.d/rc.6 script for apcupsd
|
|
to perform the shutdown on power failures. Here's the short version:
|
|
Scroll down to the end of rc.6 - you should see a section that calls
|
|
/sbin/genpowerd. Comment out (or remove) this entire section:
|
|
|
|
if [ -x /sbin/genpowerd ]; then
|
|
# See if this is a powerfail situation:
|
|
if /bin/egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then
|
|
# Signal UPS to shut off the inverter:
|
|
/sbin/genpowerd -k
|
|
if [ ! $? = 0 ]; then
|
|
echo
|
|
echo "There was an error signaling the UPS."
|
|
echo "Perhaps you need to edit /etc/genpowerd.conf to configure"
|
|
echo "the serial line and UPS type."
|
|
# Wasting 15 seconds of precious power:
|
|
/bin/sleep 15
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
|
|
Now replace that section with this (or add immediately after it if you
|
|
chose to comment out the original):
|
|
|
|
# This will cause the UPS to kill the power supply after a configurable number
|
|
# of seconds (see the apcupsd.conf file). This is important for situations
|
|
# where the mains power comes back before the UPS batteries are completely
|
|
# dead.
|
|
if [ -f /etc/apcupsd/powerfail ]; then
|
|
echo
|
|
echo "apcupsd will now power off the UPS"
|
|
echo
|
|
/etc/apcupsd/apccontrol killpower
|
|
echo
|
|
echo "Please ensure that the UPS has powered off before rebooting."
|
|
echo "Otherwise, the UPS may cut the power during the reboot."
|
|
echo
|
|
halt -f -p # power down the system if the hardware is capable
|
|
fi
|
|
|