monit-general
[Top][All Lists]
Advanced

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

PID file and restart only if not running for 2 cycles?


From: Raphael Bauduin
Subject: PID file and restart only if not running for 2 cycles?
Date: Wed, 23 Feb 2011 14:54:01 +0100

Hi,

I have a web application running sphinx, which is monitored by monit.
When deploying a new version of the app, we stop sphinx, deploy the
new code and restart sphinx.
Sometimes monit restarts sphinx during the deployment of the new code,
and when the deploy procedure wants to start sphinx, it complains it's
already running. To solve this, I would like to tell monit to restart
sphinx only if it is not running for 2 cycles. I have not found a way
to do that (I've seen example when testing services by trying to
connect to the tcp port eg, but not for plain pid checks). Here's the
kind of config I'd like to use (though this is not recognised by
monit):

check process sphinx_searchd_myapp
  with pidfile /var/run/sphinx/myapp.pid
  if does not exist 5 cycles then restart

Is this kind of config possible with "check process with pidfile"?

Thanks

raph
-- 
Web database: http://www.myowndb.com
Free Software Developers Meeting: http://www.fosdem.org



reply via email to

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