[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [monit] Check if a process is running

From: Eric Pailleau
Subject: Re: [monit] Check if a process is running
Date: Mon, 25 May 2009 09:58:33 +0200
User-agent: Thunderbird (X11/20090330)

Jan-Henrik Haukeland a écrit :

On 25. mai. 2009, at 09.35, Eric Pailleau wrote:

A solution with a wrapper script is given, but be aware that in pidfile is the PID of the wrapper script : if your program crashe (and not the wrapper), monit will still see a living PID and do nothing.

Actually not since the wrapper script uses exec, the program started will take "over" the process of the script.

yes, you are right, I did not saw it at first sight.

the only 'critic' I could give is that presence of pidfile is not tested
on 'stop' command.

it would better to do

test -s /var/run/ && kill `cat /var/run/`

'test -s' test that the file exists and size is greater than zero.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]