Page 1 of 1

Auto server restart.

Posted: Sat Oct 20, 2007 8:33 pm
by chrrox
I don't know how hard this would be but is it possible to have the server restart if it crashes like have an separate launcher or something?

Posted: Sun Oct 21, 2007 6:45 am
by LethalEncounter
The way I do it on linux is just use a script and put it inside a loop. If it crashes, then it restarts again automatically. On windows you might be able to do the same thing using .bat files. In any event, we are hoping to remove all crash bugs by the time it is ready for beta.

Posted: Sun Oct 21, 2007 11:54 am
by Riven
ideally, an external gui would do the job. taking mangos in mind (my reference of choice due to having worked for 2 years and me having worked with sources), some tools were released to solved that matter. Wait for EQ2emu to be widely spread and external programmers will come with solutions

Posted: Mon Oct 22, 2007 7:03 am
by John Adams
For Linux, you could rob some concepts from EQEmu scripting. They use a start command that sets a drop file, then calls "persist_world".
persist_world script:

Code: Select all

#!/bin/sh
ulimit -c 99999999
while true
do
        ./world "$@"
        if [ -r ".world_shutdown" ]; then
                exit 0
        fi
        echo `date` "World crashed." >>crashlog
        sleep 2
done
This will run World, then wait to see if .world_shutdown file appears, and if so, exits this script. If a crash is detected, it will log it to "crashlog".
You start persist_world with:

Code: Select all

if [ ! -e .lock-world ]
 then
 # Create a new .lock-world marker, and launch the persist_world script (keeps world alive if it crashes)
 touch .lock-world
 ./persist_world 2>&1 > logs/world &
 sleep 5
fi
You stop persist_world with:

Code: Select all

touch .world_shutdown
rm -f .lock-world
Or some variation of this. The same could be true of MS-DOS/Windows systems. Just write 2 bat files, one that writes a temp file, then loops until another temp file is detected. If shutdown is not detected, it must be a crash, so goto launch and start again. If someone else hasn't made a DOS bat later, I'll try and create one. But I use Linux, so that's what I posted. ;)
*Note these are directly hijacked from my EQEmulator, which I took from EQEmu wiki and modified.

Posted: Mon Oct 22, 2007 10:56 am
by Cadimiom
In Windows you just have a .bat file with this:

Code: Select all

:LOOP
call WorldDebug.exe
goto LOOP
Just put the .bat file in the same directory and set the worlddebug.exe to your executable for eq2emu