EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Linux Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=618)
-   -   zone-world on cron? (https://www.eqemulator.org/forums/showthread.php?t=13834)

wize_one 05-17-2004 08:10 PM

zone-world on cron?
 
i could swear i read somewhere about world and zone being cron'd.. but search not finding it..

is there a way to set world and zones on cron so if they happen to die cron will restart them?

smogo 05-18-2004 12:04 AM

write a script that checks for processes being dead or gone, then relaunches it. Cron that script.

Just an example for non parameterized script relaunching 7997, should be something like
Code:

if ! ps ax | grep "zone . myip 7997 myip"  |grep -v "grep" 1> /dev/null 2> /dev/null ; then
  echo "Zone on port 7997 is dead, restarting ..."
  startzone7997.sh
fi


then add to your crontab :
Code:

*/3 * * * * relaunchscript.sh 2>&1 >> ~/restart.log
to test every 3 mins.

Pb is deciding what to restart, if world is down, or one or more zones. Restart, one, all, ... ? Up to you ;). This is just an idea, i'd be interested in some public script if you set up one.

Doodman 05-18-2004 03:37 AM

Either that, or start them from init by setting up lines in your inittab:

(This is just a types in example, btw, your milage may vary)
Code:

#  World
w1:b:respawn:/usr/local/bin/startworld
# Zones
z1:c:respawn:/usr/local/bin/startzone . 1.1.1.1 7001 1.1.1.1
z2:c:respawn:/usr/local/bin/startzone . 1.1.1.1 7002 1.1.1.1
z3:c:respawn:/usr/local/bin/startzone . 1.1.1.1 7003 1.1.1.1
z4:c:respawn:/usr/local/bin/startzone . 1.1.1.1 7004 1.1.1.1

startworld:
Code:

#!/bin/bash
cd /path/to/eqemu
export LD_LIBRARY_PATH=.
./world

startzone:
Code:

#!/bin/bash
cd /path/to/eqemu
export LD_LIBRARY_PATH=.
./zone $*

To start world:
Code:

/sbin/telinit b
To start zones:
Code:

/sbin/telinit c
Again, just typed in, but you get the idea.


All times are GMT -4. The time now is 07:56 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.