Hi all,
I've inherited a RedHat system, and I'm trying to control some daemons using the classic start and stop mechanism.
I'm having problems understanding when and where the PID is written to the PID file. I'm not sure if the file I pass in is being used.
I've created a startup script in /etc/init.d called daemoncontrol.
Here's a snippet from the 'start' section of my daemoncontrol:
Code:
PID_FILE=/var/log/daemontest1.pid
daemon --pidfile="$PID_FILE" '/bin/launchmgr --daemon "daemontest1 -d 127.0.0.1"'
I've got an app called 'launchmgr' that expects some parameters, one of which is my daemon application (daemontest1).
I'm expecting here that the PID of the launchmgr instance will be written to the specified PID file. This doesn't appear to be the case. Instead, the PID seems to be written to /var/run/launchmgr.pid instead, as if it's always using the base of the application. Where does this happen?
I've ploughed through /etc/init.d/functions and it's not in there.
Kernel 2.6.18-164.el5