Toolserver:Phoenix

phoenix is a tool written by Daniel Kinzler that is useful for restarting programs when toolserver restarts.

Daniel made this tool known in discussion on the October 10 2008 mailing list digest.

The tool is available on wolfsbane and nightshade.

Usage
The tool has a simple help dialog, type "phoenix" on the command line and hit enter.

Generally what you do is type phoenix ~/phoenix-toolname 


 * toolname is any unique name for the tool. Both of these appear to be used by phoenix to keep track of what is running, and as a place to put tool output to.
 * The last argument (or arguments) is the command that you use to start the tool, for example: "perl /home/username/script.pl".

Generally once you have a working command, stick it in your crontab (type "crontab -e" in the commandline) to run every 5 minutes or so, and phoenix will make sure it it is running every 5 minutes, if it is not, phoenix will restart the tool).

Example
phoenix ~/phoenix-eagle-unblockbot perl /home/eagle/unblockbot/bot.pl

Using Phoenix with cron
Because cron has its own PATH, you have to specify  in your crontab: */5 * * * * /usr/local/bin/phoenix /home/yourname/phoenix-whatever-program python /home/yourname/whatever/program.py >/dev/null

Alternatively, you can set a path at the top of your crontab (somehow).

Alternatives

 * supervise
 * start-stop-daemon