--- rc.6.orig   Sat Sep 11 14:38:33 1999
+++ rc.6        Sun Feb 27 13:22:11 2000
@@ -84,11 +84,31 @@
   # This never hurts:
   sync
 
+  # This block was from the original Slackware distribution:
   # See if this is a powerfail situation.
-  if [ -f /etc/power_is_failing ]; then
-    echo "Turning off UPS, bye."
-    /sbin/powerd -q
-    exit 1
+  #if [ -f /etc/power_is_failing ]; then
+  #  echo "Turning off UPS, bye."
+  #  /sbin/powerd -q
+  #  exit 1
+  #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 @PWRFAILDIR@/powerfail ]; then
+    echo
+    echo "apcupsd will now power off the UPS"
+    echo
+    @sysconfdir@/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 kernels) or reboot.
