On Fri, 2010-01-29 at 07:54 -0800, Thomas Allen wrote: > The second is that when it does crash, I don't know about it...what > would be sufficient as a "keep-alive" script to restart it? I suppose > I could use something like EventMachine (already installed on my > server) to watch the PID file if it were deleted reliably.
If the server crashes then it clearly won't get around to deleting it's pid file. The way I do it is to use os.kill (with signal 0 IIRC) to check if the process is still alive when the script starts. If it's not then I delete the pid file and carry on starting up. Tim -- http://mail.python.org/mailman/listinfo/python-list