[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[monit] Monitoring processes without a pidfile
From: |
Daniel Clark |
Subject: |
[monit] Monitoring processes without a pidfile |
Date: |
Mon, 21 Jul 2008 12:43:39 -0400 |
Is there syntax I'm missing or a "trick" to monitor a process where
the daemon does not support the use of pid files?
I've thought of wrapping the daemon in a shell script or something,
but that wouldn't work out with logrotate et all doing a "kill -HUP"
of the process (one could of course make that use the wrapper as well,
but then things start to seem really kludgey).
I guess what I'm looking for is something like the cfengine syntax for
doing this - e.g. determine if a process is running via a regexp of
the full name of the daemon and the command line it was fed.
It looks like this is currently possible with monit for stopping a
program (see example below), but not for detecting if a program is
running / seeing what its pid is.
check process mediawiki-searchd with pidfile /var/run/sphinx-mediawiki.pid
start program = "/usr/local/bin/searchd --config
/etc/sphinx/mediawiki/sphinx.conf"
stop program = "/usr/bin/pkill -f
'searchd.*/etc/sphinx/mediawiki/sphinx.conf'"
if failed host 127.0.0.1 port 3312 then restart
if 5 restarts within 5 cycles then timeout
Cheers,
--
Daniel JB Clark # http://opensysadmin.com
- [monit] Monitoring processes without a pidfile,
Daniel Clark <=