Bug 2987 - bug in apmd init script
bug in apmd init script
Product: Red Hat Linux
Classification: Retired
Component: apmd (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
Depends On:
  Show dependency treegraph
Reported: 1999-05-23 17:07 EDT by Ian Collier
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:
Last Closed: 1999-07-01 17:29:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ian Collier 1999-05-23 17:07:11 EDT
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 17:36:59 EDT
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 17:29:59 EDT
works fine on RH6.0 here...

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