I wrote my python web application with BaseHTTPServer. It is intended to run in localhost and serve localhost requests. It is intended to be hosted in a major VPS.
So I need some reliable way to keep it alive. Apache (and what’s being served under it) can easily re-spawn when it’s stopped. Similarly, I can make CRON do a “tomcat start” periodically, so that it starts up if it went down.
How do I make my python app also alive? I prefer something that responds to commands from CRON
What you need is a process monitor, like the previously mentioned supervisord, but there’s a lot of alternatives to choose from, like God, Monit, Upstart Et.c.
I’ve only used supervisord myself, and it has got an XMLRPC-interface which you could use from your other applications, i.e. something that’s run by CRON.