[Baypiggies] Dumb "keep it running" script

Drew Perttula drewp at bigasterisk.com
Thu Sep 24 07:27:37 CEST 2009

Todd Valentic wrote:
> The one that I use quite often, especially for a bunch of TurboGears
> based sites I manage, is supervisor (written in python):
>   http://supervisord.org/

I <3 supervisord.

Here's the alive.sh demo, using supervisor:

     sudo easy_install supervisor
     virtualenv .
     bin/easy_install supervisor
     (and then prefix the rest of the commands with bin/)

   echo_supervisord_conf > supervisord.conf

   Append these lines to the end of supervisord.conf:

   supervisord -c supervisord.conf
   (daemon is launched)

   tail -f /tmp/alive-stdout*
   (watch the output of the command)

There are lots of controls for what to do if alive.sh goes down, how 
many times to retry, for how long, etc.

Controlling the process:
1. supervisorctl -c supervisord.conf
    That launches an interactive console for starting/stopping/checking

2. You can also turn on a web UI that looks like this:

3. You can talk to supervisord over xmlrpc, too.

More information about the Baypiggies mailing list