I use apmd-3.0final-2 on a RedHat 6.1 system. The startup scripts for the apmd daemon use deprecated options (refer to apmd manual page) to run a shell script on suspend or resume. With apmd-3.0 these options do not work anymore. I made the following changes to get it working again (NOTE: some lines in the following diff log could be wrapped caused by length limitation): --- /etc/rc.d/apmd.orig Tue Oct 26 13:36:53 1999 +++ /etc/rc.d/init.d/apmd Tue Jul 11 15:08:37 2000 @@ -32,9 +32,9 @@ APMD_OPTIONS="$APMD_OPTIONS -u" fi - #daemon /usr/sbin/apmd "$APMD_OPTIONS" - daemon /usr/sbin/apmd -p $LOGPERCENTCHANGE -w $WARNPERCENT $ADDPARAMS $PRESUSPENDCMD \ - $POSTRESUMECMD $LOWBATCMD $ACONCMD $ACOFFCMD + daemon /usr/sbin/apmd "$APMD_OPTIONS" + #daemon /usr/sbin/apmd -p $LOGPERCENTCHANGE -w $WARNPERCENT $ADDPARAMS $PRESUSPENDCMD \ + # $POSTRESUMECMD $LOWBATCMD $ACONCMD $ACOFFCMD RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/apmd echo --- /etc/sysconfig/apmd.orig Mon Jan 17 13:07:03 2000 +++ /etc/sysconfig/apmd Tue Jul 11 14:29:10 2000 @@ -1,29 +1,4 @@ -APMSCRIPTS=/etc/sysconfig/apm-scripts - -# make an entry in the logfiles whenever the percentage of -# battery power changes below the value specified here -LOGPERCENTCHANGE=10 - -# warn on specified remainig battery percentage -WARNPERCENT=5 - -# use -W to warn all users in a critical power state -ADDPARAMS="-W" - -# use -s for command execution before entering the suspend state -PRESUSPENDCMD="-s $APMSCRIPTS/suspend" - -# use -r for command execution after resuming from a suspend state -POSTRESUMECMD="-r $APMSCRIPTS/resume" - -# use -l for command execution on low battery -LOWBATCMD="" - -# use -a for command execution on switching to ac power -ACONCMD="" - -# use -b for command execution on switching to battery power -ACOFFCMD="" +APMD_OPTIONS="-P /etc/sysconfig/apm-scripts/apmscript -p 10 -w 5 -W" # if you have problems with your X display after returning from suspend mode # give CHANGEVT the number of the virtual terminal your X-Server runs on --- /etc/sysconfig/apm-scripts/apmscript.orig Tue Jul 11 14:41:38 2000 +++ /etc/sysconfig/apm-scripts/apmscript Tue Jul 11 14:08:48 2000 @@ -10,7 +10,7 @@ # # This script can be controlled by editing /etc/sysconfig/apmd. -PROG=`basename "$0"` +PROG="$1" LOCKFILE=/var/lock/subsys/resume [ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard [ -e /etc/sysconfig/apmd ] && . /etc/sysconfig/apmd
This bug could be a duplicate of Bug 2396 and related. I noticed, that each time the machine suspends and resumes later, the system clock was put on by two hours regardeless whether I set CLOCK_SYNC to "yes".
Thanks, fixed (in -11). (Using a different way though. There's no reason whatsoever to remove LOGPERCENTCHANGE and WARNPERCENT).