August 03, 2006 Archives

Thu 3 Aug 2006 @ 14:38 (1154608738)

hibernate with apcupsd

Una modifichina "quick and dirty" per far andare la mia workstation in suspend
quando apcupsd decide che e' ora di spegnere tutto:

--- /etc/apcupsd/apccontrol_ORIG        2006-08-03 14:04:19.000000000 +0200
+++ /etc/apcupsd/apccontrol     2006-08-03 14:05:51.000000000 +0200
@@ -21,6 +21,7 @@
 APCPID=/var/run/apcupsd.pid
 APCUPSD=/sbin/apcupsd
 SHUTDOWN=/sbin/shutdown
+HIBERNATE=/usr/sbin/hibernate
 SCRIPTSHELL=/bin/sh
 SCRIPTDIR=/etc/apcupsd
 WALL=wall
@@ -105,7 +106,7 @@
     ;;
     doshutdown)
        echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
-       ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
+       ${HIBERNATE}
     ;;
     annoyme)
        echo "Power problems with UPS ${2}. Please logoff." | ${WALL}

-----

Posted by shammash | Permanent Link | Categories: tech