Bug 2987

Summary: bug in apmd init script
Product: [Retired] Red Hat Linux Reporter: Ian Collier <imc>
Component: apmdAssignee: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-07-01 21:29:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ian Collier 1999-05-23 21:07:11 UTC
I disagree with bug #1500.  If you quote the APMD_OPTIONS
then the shell will pass them as a single argument to the
apmd program.  Supposing /etc/sysconfig/apmd says

APMD_OPTIONS="-u -s /etc/apmd/suspend -r /etc/apmd/resume"

this will result in the following:

starbright:83-i# /etc/rc.d/init.d/apmd start
Starting up APM daemon: apmd /usr/sbin/apmd: invalid option
usage: apmd [-VvuW] [-p percent] [-w percent] [-c seconds]
            [-s pre_suspend_cmd] [-r post_resume_cmd]
            [-l low_battery_cmd]

The message occurs (I presume) because apmd sees the whole
command line as an argument to the -u flag, and the -u flag
doesn't take arguments.  Removing the quotes from
APMD_OPTIONS results in apmd being started correctly.

If it matters I am using apmd-3.0beta5-7 as taken from Red
Hat 6.0 and recompiled on Red Hat 5.1.

Ian Collier.

Comment 1 Ian Collier 1999-05-23 21:36:59 UTC
On second thoughts it might be better to write:

eval "daemon /usr/sbin/apmd $APMD_OPTIONS"

because that allows the user to use quoted strings in APMD_OPTIONS.


Comment 2 Bill Nottingham 1999-07-01 21:29:59 UTC
works fine on RH6.0 here...