Bug 13710 - Use of deprecated options (apmscript never called)
Use of deprecated options (apmscript never called)
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: apmd (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-11 08:55 EDT by c.brauckmann
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-07-11 09:12:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description c.brauckmann 2000-07-11 08:55:11 EDT
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
Comment 1 c.brauckmann 2000-07-11 09:12:26 EDT
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".
Comment 2 Bernhard Rosenkraenzer 2000-07-17 08:07:06 EDT
Thanks, fixed (in -11). (Using a different way though. There's no reason
whatsoever to remove LOGPERCENTCHANGE and WARNPERCENT).

Note You need to log in before you can comment on or make changes to this bug.