--- rc.6.orig 2005-02-09 15:54:51.000000000 -0500 +++ rc.6 2005-02-09 15:57:22.000000000 -0500 @@ -185,20 +185,38 @@ # This is to ensure all processes have completed on SMP machines: wait -if [ -x /sbin/genpowerd ]; then +# This block was from the original Slackware distribution: +#if [ -x /sbin/genpowerd ]; then # See if this is a powerfail situation: - if egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then +# if 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." +# /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: - sleep 15 - fi - fi +# sleep 15 +# fi +# fi +#fi + +# This block was added in by the apcupsd installation process. 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 # Now halt (poweroff with APM or ACPI enabled kernels) or reboot.