RedHat: Daemons
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 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 |
The standard for PID files is actually /var/run/
/var/log is for log files. Why not just change your app to look for the pid file in /var/run instead? Did you write the program that creates the pid in /var/run? |
Bah! Typo!
The path is set as /var/run/! That makes the definition of the variable: Code:
PID_FILE=/var/run/daemontest1.pid Using echo statements in the 'daemon' function, I can see that my specified PID_FILE is passed through correctly. However, after this section: Code:
# And start it up. |
All times are GMT -5. The time now is 01:55 AM. |