http://qs321.pair.com?node_id=604001


in reply to Re: Auto-restarting script if it dies
in thread Auto-restarting script if it dies

On Unix, daemontools provides a fairly straightforward way to do exactly what merlyn describes without writing any code. It goes a step further, and has one additional process monitoring all of the monitoring process, with that process restarted by init. That's pretty foolproof, and it's straightforward to set up many monitored services.