On Sat, Oct 18, 2008 at 7:26 AM, Daniel Kinzler <[EMAIL PROTECTED]> wrote: > Hi all > > We have all seen the problem that some script or bot we have come to rely upon > suddenly dies. Or fails to restart when the toolserver is rebooted. Putting > something into cron to be run on @reboot sadly doesn't always work, for > example > because the home directory may not yet be mounted when cron runs reboot jobs.
We should have a per-user initialisation script that are all run during startup by rc.local. > So, after a short discussion on IRC, i wrote a script to take care of this. I > called if phoenix, it's available in the system path on nightshade and > hemlock. > > Phonix just starts whatever command you give to it, but it first checks if > that > command is already running. If it is already running, phoenix does nothing. > So, > just call phonix from cron every few minutes to make sure your bot is > restarted > when it dies. > > For example, if you want to run 'mybot', call this every few minutes from > cron: > > phoenix /tmp/yourname-mybot /home/mydir/bin/mybot someparam > > The path /tmp/yourname-mybot is the base fir the PID and output files - output > fill be written to /tmp/yourname-mybot.out, the processes pid will be stored > in > /tmp/yourname-mybot.pid. > > The second parameter, /home/mydir/bin/mybot, is the program to run. Anything > following that are parameters to pass to this program. > > > Please try it out and tell me about any problems! phoenix also prints a short > help message when called without any parameters. > > -- daniel > > PS: I'm sure this wheel has been invented before... any pointers? [[init]] is the original program given this task, and is still often used for this purpose. The wiki page lists other tools that have been written to help with this. svscan from [[daemontools]] is a good one. -- John Vandenberg _______________________________________________ Toolserver-l mailing list Toolserver-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/toolserver-l