Toolserver:Phoenix

From mediawiki.org

This page was moved from the Toolserver wiki.
Toolserver has been replaced by Toolforge. As such, the instructions here may no longer work, but may still be of historical interest.
Please help by updating examples, links, template links, etc. If a page is still relevant, move it to a normal title and leave a redirect.

This page is obsolete: Phoenix has been superseded by the job scheduling system, which should be used for all new tools. The previous content of this page is provided for historical interest.


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[edit]

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

A typical command line might be:

phoenix ~/phoenix-<toolname> <command to start the tool, with full paths>
  • <toolname> 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 <toolname>, 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[edit]

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

Using Phoenix with cron on Linux[edit]

Because cron has its own PATH, you have to specify /usr/local/bin/phoenix in your crontab:

*/5 * * * * /usr/local/bin/phoenix $HOME/phoenix-whatever-program python $HOME/whatever/program.py >/dev/null

Alternatively, you can set a path at the top of your crontab:

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

Using Phoenix with cron on Solaris[edit]

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[edit]

See also[edit]

Category:Tools Category:Commands