Bug 1143 - /etc/init.d/apmd tries to create to pid-files and aborts
Bug#: 1143 Product:  Gentoo Linux Version: 1.0 RC6 r14 Platform: x86
OS/Version: Linux Status: RESOLVED Severity: minor Priority: P2
Resolution: FIXED Assigned To: azarah@gentoo.org Reported By: gentoo-bug@abc.delta64.com
Component: Applications
URL: 
Summary: /etc/init.d/apmd tries to create to pid-files and aborts
Keywords:  
Status Whiteboard: 
Opened: 2002-03-14 07:27 0000
Description:   Opened: 2002-03-14 07:27 0000
/etc/init.d/apmd start fails saying that another apmd is already
started, and I should delete /var/run/apdm.pid if this is not correct.

Found out, that apmd creates its pid-file and the option 
--make-pidfile --pidfile /var/run/apmd.pid tries to create another one

fix: change to:
#       start-stop-daemon --start --quiet --exec /usr/sbin/apmd \
#               --make-pidfile --pidfile /var/run/apmd.pid -- ${APMD_OPTS}
        start-stop-daemon --start --quiet --exec /usr/sbin/apmd -- ${APMD_OPTS}

------- Comment #1 From Martin Schlemmer (RETIRED) 2002-03-14 15:47:09 0000 -------
Hi

I do not use APM, but ACPI, so if you could help me here ..

Try to change it to:

    start-stop-daemon --start --quiet --pidfile /var/run/apmd.pid \
        --startas /usr/sbin/apmd -- ${APMD_OPTS}

and see if that works fine.

The difference is, it will start apmd, and then check if the pid is created ok.

------- Comment #2 From Donny Davies (RETIRED) 2002-03-17 21:30:07 0000 -------
fixed.  thanks to Christian and Azarah for analysis.