mercadodei mercado a écrit :
Hello All
To check if a process is running the only thing I have to do is :
check process <process> with pidfile "/var/run/<process>.pid"
start = "/etc/init.d/<process> start"
stop = "/etc/init.d/<process> stop"
right ?
and if the process doesn't have pid file (I know that this question is
already answered but I would like to know your opinions)
Thanks
------------------------------------------------------------------------
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
In addition to my May 23rd 's mail,
you can also look at FAQ in Monit Wiki.
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.
My solution use real PID of your program.
Another hint :
the 'ps' command I gave you give ALL PID of a program :
if your program forks with several children you may rather
use father PID. In such case replace :
ps -C nopidfilebinaray -o pid= | tr -d ' '
by
ps -C nopidfilebinaray -o pid= | head -1 | tr -d ' '
regards
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general