Server restart script
Robert Mount
rmount at pobox.com
Tue Aug 17 13:40:28 EDT 2004
----- Original Message -----
From: "Andrew (KARZAC) Furbey" <andrewfurbey at hotmail.com>
To: <mohaa at icculus.org>
Sent: Tuesday, August 17, 2004 11:53 AM
Subject: Re: [mohaa] mohaa process freezes
> does anyone know of a script that can restart a server when it crashes BUT
> it leaves the procces running, i think it might be what your talking
> about,
> but i was running the server as "root", and it used to crash about twice a
> day also, then created a user account and started it via that, and its
> still
> running, no crashes 2 days later.
Here's my script:
****
#!/bin/bash
#
# MOH Server loop
#
clear
while [ 1 ] # Loop `forever'
do
echo "Starting the server"
cd /home/mohsh01
screen -m -D -S mohsh01 ./spearhead_lnxded +set net_ip 1.1.1.1 +exec
server.cfg
sleep 60
echo "Done sleeping"
done
*****
I use this command from another script to start my servers:
su mohsh01 -c "/opt/control/mohsh01 &"
I run this as the user "mohsh01" not as root. Only problem with this is
there's no web control for it that i can figure out. I'd love to have a
looper (as above) with some way to shut the server down over the web.
--Rob
More information about the Mohaa
mailing list