On Fri, 2010-01-29 at 07:54 -0800, Thomas Allen wrote: > I have a script that runs an instance of SimpleXMLRPCServer and in > general it works as expected. In its __del__, it is supposed to clean > up its PID file (written on boot). I have two problems with this > server instance: The first is that tt doesn't always clean up its PID > file; is there a more reliable way to do this than how I am currently? > 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.
Why don't you wrap the server in a try/except block? Then if an exception occurs killing the server you can automatically restart and/or send an e-mail to an admin address. -- http://mail.python.org/mailman/listinfo/python-list