Toolserver:Phoenix

phoenix is a tool written by Daniel Kinzler that is useful for restarting programs when the Toolserver restarts. It is available on wolfsbane, willow and nightshade.

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

A typical command line might be: phoenix ~/phoenix- 


 * is any unique name for the tool. This will be used as the logfile for the command's output.
 * The remaining arguments are the command to run, for example: perl /home/username/script.pl

The first time you run this command for a particular, phoenix will start the program. The next time it's run, if the program is already running, it will not do anything. This means you can cron phoenix regularly from cron, and if the tool isn't running (because it crashed, or the server rebooted) it will be restarted.

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

Using Phoenix with cron on Linux
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:

PATH=/usr/local/bin */5 * * * * phoenix /home/yourname/phoenix-whatever-program python /home/yourname/whatever/program.py >/dev/null

Using Phoenix with cron on Solaris
On Solaris there is no need to specify the full path. However, the "/" syntax is not supported (see Using Solaris), so use this instead:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * phoenix /home/yourname/phoenix-program python /home/yourname/whatever/program.py

Alternatives

 * supervise
 * start-stop-daemon