[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Configuring monit to keep application running
From: |
Jan-Henrik Haukeland |
Subject: |
Re: Configuring monit to keep application running |
Date: |
Tue, 16 Sep 2014 00:25:16 +0200 |
On 15 Sep 2014, at 23:52, chinaboy <address@hidden> wrote:
> check process SimpleHelp with path /opt/SimpleHelp
> start program = "/etc/init.d/simplehelp start"
> stop program = "/etc/init.d/simplehelp stop”
Monit needs to read the Process ID of SimpleHelp (assuming it is a
server-program) from a file. A so called pid-file which contains one entry only
which is the process-id. This file must then be specified in the check process
statement which could look something like
check process SimpleHelp with path /opt/SimpleHelp/simplehelp.pid
start program = "/etc/init.d/simplehelp start"
stop program = "/etc/init.d/simplehelp stop”
If your script needs to create the pid file, do something like this in bash:
echo $$ > /opt/SimpleHelp/simplehelp.pid;
$$ is the process-id of the script. Don’t background anything with ‘&’ in which
case the process-id will be wrong. More info can be found here:
http://mmonit.com/wiki/Monit/FAQ#pidfile