Difference between revisions of "Eathena Debian Openvz Compile"

From MS Computech
Jump to: navigation, search
(New page: How to Compile Eathena On Openvz Container<br> <pre>#apt-get install build-essential zlib1g-dev mysql-server libmysqlclient15-dev php5 apache2 phpmyadmin php5-mysql </pre> Cd to your eathe...)
(No difference)

Revision as of 16:56, 16 November 2008

How to Compile Eathena On Openvz Container

#apt-get install build-essential zlib1g-dev mysql-server libmysqlclient15-dev php5 apache2 phpmyadmin php5-mysql

Cd to your eathena folder and extract em all

#./configure --with-MYSQL_LIBS=/usr/lib/libmysqlclient.so
#make sql

Make Luncher : Credit EA Bord User Jabber

#nano Ealuncher
#!/bin/bash
  1. eAthena generic server starter v1.0, by Kant
  2. author contact info:
  3. e-mail / jabber: [email protected]
  4. msn messenger: [email protected]
  5. note: the original filename of this script is "srv"
  6. Usage:
  7. /.srv A B
  8. A is the server you want to start (login, char or map)
  9. B is the type (sql or txt). if none given, txt will be chosen.(see comments
  10. below for details on this)
  1. Which server to start?

case $1 in login ) srv=$1;; char ) srv=$1;; map ) srv=$1;;

  • ) echo wrong server
   exit;;

esac

  1. SQL or TXT?
  2. this check is done because the eA makefile spits the "_sql" at the end of
  3. binaries when it compiles for sql usage.

case $2 in sql ) type="_sql";; txt ) type="";;

  • ) type="";;

esac

  1. Check if selected server exists. If not, exit with message

test -e ${srv}-server${type} case $? in 1 ) echo server does not exist!

   exit;;

esac

  1. Check if selected is executable. If not, exit with message

test -x ${srv}-server${type} case $? in 1 ) echo server is not executable!

   exit;;

esac


  1. Test a control file. 1 means the server starts, 0 means the server doesnt
  2. start. if there is no file, the scripts ignore the check.

test -e start.txt case $? in 0 ) case $(cat start.txt) in

   0 )    echo server deactivated, look in start.txt
       exit;;
   esac;;

esac

  1. server restart loop

while true do

  1. Notify server start

echo \[`date +"%Y-%m-%d--%H:%M:%S"`\] starting ${1}-server... | tee -a logs/${1}-server.txt

  1. start server acording to parameters

./${srv}-server${type} exit=$?

  1. depending on exit code, stop the loop or restart

case $exit in

  1. there is something wring in the configuration, do not restart

1 ) echo \[`date +"%Y-%m-%d--%H:%M:%S"`\] ${1}-server config is wrong | tee -a logs/${1}-server.txt

   exit;;
  1. the server was killed by the user, restart

0 ) echo \[`date +"%Y-%m-%d--%H:%M:%S"`\] ${1}-server killed by user | tee -a logs/${1}-server.txt

   sleep 5;;
  1. there was a crash because of a bug, restart
  2. exit code 127 means server crash
  • ) echo \[`date +"%Y-%m-%d--%H:%M:%S"`\] !!! ${1}-server down, exit code is $exit | tee -a logs/${1}-server.txt
   sleep 5;;

esac

done

#chmod +x Ealuncher


Finish Compile