das kannst du entweder per crontab machen, das zB alle 10 minuten checkt ob der server noch läuft oder per start/stop script.
Hier ist ein Crontab für den Apache. Das kann man recht simple anpassen, wenn der teeworld server ein pid file erstellt!
#! /bin/sh
# To check every 10 minutes, put the following line in your
# crontab:
# */10 * * * * /opt/apache2/a2crontab
# And if you don't want to get email from crontab when it checks,
# put the following in your crontab:
# */10 * * * * /opt/apache2/a2crontab >/dev/null 2>&1
# the name of the pidfile
pidfile="/var/run/apache2.pid";
########## you probably don't need to change anything below here ##########
cd $basedir
if [ -e '$pidfile' ];
then
# there is a pid file -- is it current?
pid=`cat $pidfile`;
if `kill -CHLD $pid >/dev/null 2>&1`;
then
# it's still going -- back out quietly
exit 0
fi
# echo "";
# echo "Stale $pidfile file, erasing...";
rm -f $pidfile;
fi
/etc/init.d/apache2 start > /dev/null;
Alles anzeigen
btw. teeworld rocks.