monit-general
[Top][All Lists]
Advanced

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

Re: How to check for a path in a url and restart runit if fails


From: Eric PAILLEAU
Subject: Re: How to check for a path in a url and restart runit if fails
Date: Thu, 12 Apr 2012 09:57:10 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

Le 12/04/2012 09:06, David Montgomery a écrit :
Hi,  agreed about using restart as being more elegant. But I am having
and issues about restarting the runit service after I try and break it
under load using apache AB using a t1.micro.

if I use the below..the service will never restart.  the pixelServer
is a python web.py script executed using spawn-fcgi.  I am using nginx
and unix sockets (unixsocket /tmp/nginx9002.socket).

In monit...I still get a green light for the service as well


check process pixelServer
   with pidfile "/etc/sv/pixelServer/supervise/pid"
   start program = "/usr/bin/sv start pixelServer"
   stop program = "/usr/bin/sv kill pixelServer"
   if failed host 127.0.0.1 port 80 protocol http
   request /pixel
   then restart


Hi,
something like below may help.
This ensure that no process is still running before doing a start.
check process pixelServer
   with pidfile "/etc/sv/pixelServer/supervise/pid"
   start program = "/usr/bin/killall pixelServer && sleep 2 ; usr/bin/sv start pixelServer"
   stop program = "/usr/bin/sv kill pixelServer"
   if failed host 127.0.0.1 port 80 protocol http
   request /pixel
   then restart



--

reply via email to

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