Auto server restart.

Old feature requests stored here for reference.
Locked
chrrox
Content Designer
Posts: 177
Joined: Wed Oct 17, 2007 8:12 pm

Auto server restart.

Post by chrrox » Sat Oct 20, 2007 8:33 pm

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?

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Sun Oct 21, 2007 6:45 am

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.

Riven
Retired
Posts: 113
Joined: Thu Aug 30, 2007 3:11 am
Location: Spain

Post by Riven » Sun Oct 21, 2007 11:54 am

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

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Oct 22, 2007 7:03 am

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.

Cadimiom
Team: Zombie
Posts: 74
Joined: Wed Jul 25, 2007 2:31 pm

Post by Cadimiom » Mon Oct 22, 2007 10:56 am

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

Locked

Who is online

Users browsing this forum: No registered users and 0 guests