Launch script for cron

From: The Merciless Lord of Everything (
Date: 01/19/00


I got tired of always having to login to run up the mud whenever the
machine was rebooted (has happend quite frequently lately sadly :) So I
sat down and wrote this script to be put in cron, that way even if the
autorun script should determine to crash (god should know why though),
it'd get started 15 minutes later.

Somewhere in the top of autorun put in these lines, I put it before the
PORT=????? assigment, but anywhere before 'while ( : ) do' should actually

if [ -f $PID ]; then
# Check if autorun is running, if so, do nothing!
   PID=`cat $PIDFILE`
   kill -0 $PID 2>&1 && echo autorun already running, exitting && exit
echo $$ > $PIDFILE
....(Autorun continues as normally)

this is meant as a security for autorun, so it won't start up twice.

after that I made this launcher (I called it
---- START ----
# 0,30 * * * * $HOME/

# Path to the program

# The Program Name

# The PIDfile

if [ -f $pidfile ]; then
 pid=`cat $pidfile`
 kill -0 $pid 2>&1 || (cd $path;rm -f $pidfile;./$prog 2>&1 &)
  (cd $path;./$prog 2>&1 &)
----- END ----

And dumped this into my crontab with
0,30 * * * * $HOME/

Whoop, I now get it up at latest 30 minutes after a reboot of the
machine. I thas been tested on a FreeBSD and on a Linux system (I dunno if
it is compatible with other *Nices, though I see no reason why not).

If you chose to use this, be aware that I use my standard disclaimer "You
use it, Your fault if something breaks!" :) though I can't see why
anything should happen.. :)


S. P. Skou

"The Law of Self Sacrifice"
When you starve with a tiger, the tiger starves last.

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

This archive was generated by hypermail 2b30 : 04/10/01 PDT