From e947363b235dca534ed0559546b9f74622f004cc Mon Sep 17 00:00:00 2001 From: Yehonal Date: Fri, 2 Sep 2016 00:05:55 +0200 Subject: Typing error in folder name --- modules/acore/startup-scripts/conf.sh.dist | 36 ++++++++ .../startup-scripts/examples/restarter-auth.sh | 14 +++ .../startup-scripts/examples/restarter-world.sh | 14 +++ .../acore/startup-scripts/examples/starter-auth.sh | 14 +++ .../startup-scripts/examples/starter-world.sh | 14 +++ modules/acore/startup-scripts/run-engine | 102 +++++++++++++++++++++ modules/acore/startup-scripts/starter | 27 ++++++ modules/acore/startup-scritps/conf.sh.dist | 36 -------- .../startup-scritps/examples/restarter-auth.sh | 14 --- .../startup-scritps/examples/restarter-world.sh | 14 --- .../acore/startup-scritps/examples/starter-auth.sh | 14 --- .../startup-scritps/examples/starter-world.sh | 14 --- modules/acore/startup-scritps/run-engine | 102 --------------------- modules/acore/startup-scritps/starter | 27 ------ 14 files changed, 221 insertions(+), 221 deletions(-) create mode 100644 modules/acore/startup-scripts/conf.sh.dist create mode 100644 modules/acore/startup-scripts/examples/restarter-auth.sh create mode 100644 modules/acore/startup-scripts/examples/restarter-world.sh create mode 100644 modules/acore/startup-scripts/examples/starter-auth.sh create mode 100644 modules/acore/startup-scripts/examples/starter-world.sh create mode 100644 modules/acore/startup-scripts/run-engine create mode 100755 modules/acore/startup-scripts/starter delete mode 100644 modules/acore/startup-scritps/conf.sh.dist delete mode 100644 modules/acore/startup-scritps/examples/restarter-auth.sh delete mode 100644 modules/acore/startup-scritps/examples/restarter-world.sh delete mode 100644 modules/acore/startup-scritps/examples/starter-auth.sh delete mode 100644 modules/acore/startup-scritps/examples/starter-world.sh delete mode 100644 modules/acore/startup-scritps/run-engine delete mode 100755 modules/acore/startup-scritps/starter (limited to 'modules') diff --git a/modules/acore/startup-scripts/conf.sh.dist b/modules/acore/startup-scripts/conf.sh.dist new file mode 100644 index 0000000000..fbf31e3cab --- /dev/null +++ b/modules/acore/startup-scripts/conf.sh.dist @@ -0,0 +1,36 @@ +# enable/disable GDB execution +export GDB_ENABLED=0 + +# gdb file +export GDB="" + +# directory where binary are stored +export BINPATH="" + + ### Put here the pid you configured on your worldserver.conf file ### +export SERVERPID="" + +# path to conf file +export CONFIG="" + +# path of log files +export LOGS_PATH=""; + +# exec name +export SERVERBIN="" + +# prefix name for log files +export LOG_PREFIX_NAME="" + +# name of screen service ( for restarter ) +# if no specified, screen util won't be used +export SCREEN_NAME="" + +# overwrite default screen options: -A -m -d -S +export SCREEN_OPTIONS="" + +# enable it to show the output +# within console +export WITH_CONSOLE=0 + + diff --git a/modules/acore/startup-scripts/examples/restarter-auth.sh b/modules/acore/startup-scripts/examples/restarter-auth.sh new file mode 100644 index 0000000000..579c8c5b8e --- /dev/null +++ b/modules/acore/startup-scripts/examples/restarter-auth.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +$PATH_RUNENGINE="" + +source $PATH_RUNENGINE/run-engine + +# you must create your conf +# copying conf.sh.dist +# and renaming as below +source ./conf-auth.sh + +restarter + + diff --git a/modules/acore/startup-scripts/examples/restarter-world.sh b/modules/acore/startup-scripts/examples/restarter-world.sh new file mode 100644 index 0000000000..036248a99f --- /dev/null +++ b/modules/acore/startup-scripts/examples/restarter-world.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +$PATH_RUNENGINE="" + +source $PATH_RUNENGINE/run-engine + +# you must create your conf +# copying conf.sh.dist +# and renaming as below +source ./conf-world.sh + +restarter + + diff --git a/modules/acore/startup-scripts/examples/starter-auth.sh b/modules/acore/startup-scripts/examples/starter-auth.sh new file mode 100644 index 0000000000..a6947a39fd --- /dev/null +++ b/modules/acore/startup-scripts/examples/starter-auth.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +$PATH_RUNENGINE="" + +source $PATH_RUNENGINE/run-engine + +# you must create your conf +# copying conf.sh.dist +# and renaming as below +source ./conf-auth.sh + +starter + + diff --git a/modules/acore/startup-scripts/examples/starter-world.sh b/modules/acore/startup-scripts/examples/starter-world.sh new file mode 100644 index 0000000000..380a57c8e9 --- /dev/null +++ b/modules/acore/startup-scripts/examples/starter-world.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +$PATH_RUNENGINE="" + +source $PATH_RUNENGINE/run-engine + +# you must create your conf +# copying conf.sh.dist +# and renaming as below +source ./conf-world.sh + +starter + + diff --git a/modules/acore/startup-scripts/run-engine b/modules/acore/startup-scripts/run-engine new file mode 100644 index 0000000000..7cecaeb134 --- /dev/null +++ b/modules/acore/startup-scripts/run-engine @@ -0,0 +1,102 @@ +export RUN_ENGINE_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# load default conf +if [ -e "$RUN_ENGINE_PATH/conf.dist" ]; then + source "$RUN_ENGINE_PATH/conf.sh.dist" +fi + +function configureFiles() { + TRACE_BEGIN_STRING="SIGSEGV" + TRACE_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_trace.log" + ERR_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_error.log" + SYSLOG="$LOGS_PATH/"$LOG_PREFIX_NAME"_system.log" + SYSERR="$LOGS_PATH/"$LOG_PREFIX_NAME"_system.err" + LINKS_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_crash_links.link" +} + +function checkStatus() { + local ret=1 + # wipe do : destroy old screens + ls + screen -wipe + if screen -ls $1 | grep -q "No Sockets found" + then + return 0 + fi + + local gdbres=$(pgrep -f "gdb -x $GDB --batch $SERVERBIN") + if [[ $GDB_ENABLED -eq 0 && -z $gdbres ]]; then + return 0 + fi + + # + # This is a specific check for Azeroth Core in case of screen failure + # It is possible since same binary file cannot be launched with same configuration file + # This is an extra check + # + local binres=$(pgrep -f "$SERVERBIN -c $CONFIG") + if [ -z $binres ]; then + return 0 + fi + + return 1 +} + +function run() { + echo $1 + if [ ! -z $1 ]; then + local OPTIONS="-A -m -d -S" + if [ ! -z "$SCREEN_OPTIONS" ]; then + OPTIONS=$SCREEN_OPTIONS + fi + + echo "> Starting with screen ( screen $OPTIONS )" + + screen $OPTIONS $1 "$RUN_ENGINE_PATH/starter" $2 $3 "$4" "$5" "$6" $7 + else + $RUN_ENGINE_PATH/starter $2 $3 "$4" "$5" "$6" $7 + fi +} + +function starter() { + cd $BINPATH + + mkdir -p "$LOGS_PATH" + + configureFiles + + run "$SCREEN_NAME" "$SERVERBIN" "$GDB" "$CONFIG" "$SYSLOG" "$SYSERR" "$GDB_ENABLED" +} + + +function restarter() { + cd $BINPATH + + mkdir -p "$LOGS_PATH" + + configureFiles + + if [ ! -f $TRACE_FILE ]; then + touch $TRACE_FILE + fi + + while : + do + if checkStatus $SCREEN_NAME; then + DATE=$(date) + echo "Restarting $SCREEN_NAME Core blizz($DATE)" + if [ $GDB_ENABLED -eq 1 ]; then + echo "GDB enabled" + grep -B 10 -A 1800 "$TRACE_BEGIN_STRING" "$SYSLOG" >> "$TRACE_FILE" + cat "$SYSERR" > "$ERR_FILE" + run "$SCREEN_NAME" "$SERVERBIN" "$GDB" "$CONFIG" "$SYSLOG" "$SYSERR" 1 + fi + + if [ $GDB_ENABLED -eq 0 ]; then + echo "GDB disabled" + run "$SCREEN_NAME" "$SERVERBIN" null "$CONFIG" null null 0 + fi + fi + + sleep 10 + done +} diff --git a/modules/acore/startup-scripts/starter b/modules/acore/startup-scripts/starter new file mode 100755 index 0000000000..2f98ea40f9 --- /dev/null +++ b/modules/acore/startup-scripts/starter @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +GDB_FILE="$2" +CONFIG="$3" +SYSLOG="$4" +SYSERR="$5" +GBD_ENABLED="$6" + +if [ $GBD_ENABLED -eq 1 ]; then + echo "set logging on" > "$GDB_FILE" + echo "set debug timestamp" >> "$GDB_FILE" + echo "run -c $3" >> "$GDB_FILE" + echo "bt" >> "$GDB_FILE" + + [ ! -f "$SYSLOG" ] && touch "$SYSLOG" + [ ! -f "$SYSERR" ] && touch "$SYSERR" + + if [ $WITH_CONSOLE -eq 0 ]; then + gdb -x $GDB_FILE --batch $1 >> "$SYSLOG" 2>> "$SYSERR" + else + echo "> Console enabled" + gdb -x $GDB_FILE --batch $1 > >(tee ${SYSLOG}) 2> >(tee ${SYSERR} >&2) + fi + +elif [ $GBD_ENABLED -eq 0 ]; then + "./$1" -c "$CONFIG" +fi diff --git a/modules/acore/startup-scritps/conf.sh.dist b/modules/acore/startup-scritps/conf.sh.dist deleted file mode 100644 index fbf31e3cab..0000000000 --- a/modules/acore/startup-scritps/conf.sh.dist +++ /dev/null @@ -1,36 +0,0 @@ -# enable/disable GDB execution -export GDB_ENABLED=0 - -# gdb file -export GDB="" - -# directory where binary are stored -export BINPATH="" - - ### Put here the pid you configured on your worldserver.conf file ### -export SERVERPID="" - -# path to conf file -export CONFIG="" - -# path of log files -export LOGS_PATH=""; - -# exec name -export SERVERBIN="" - -# prefix name for log files -export LOG_PREFIX_NAME="" - -# name of screen service ( for restarter ) -# if no specified, screen util won't be used -export SCREEN_NAME="" - -# overwrite default screen options: -A -m -d -S -export SCREEN_OPTIONS="" - -# enable it to show the output -# within console -export WITH_CONSOLE=0 - - diff --git a/modules/acore/startup-scritps/examples/restarter-auth.sh b/modules/acore/startup-scritps/examples/restarter-auth.sh deleted file mode 100644 index 579c8c5b8e..0000000000 --- a/modules/acore/startup-scritps/examples/restarter-auth.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -$PATH_RUNENGINE="" - -source $PATH_RUNENGINE/run-engine - -# you must create your conf -# copying conf.sh.dist -# and renaming as below -source ./conf-auth.sh - -restarter - - diff --git a/modules/acore/startup-scritps/examples/restarter-world.sh b/modules/acore/startup-scritps/examples/restarter-world.sh deleted file mode 100644 index 036248a99f..0000000000 --- a/modules/acore/startup-scritps/examples/restarter-world.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -$PATH_RUNENGINE="" - -source $PATH_RUNENGINE/run-engine - -# you must create your conf -# copying conf.sh.dist -# and renaming as below -source ./conf-world.sh - -restarter - - diff --git a/modules/acore/startup-scritps/examples/starter-auth.sh b/modules/acore/startup-scritps/examples/starter-auth.sh deleted file mode 100644 index a6947a39fd..0000000000 --- a/modules/acore/startup-scritps/examples/starter-auth.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -$PATH_RUNENGINE="" - -source $PATH_RUNENGINE/run-engine - -# you must create your conf -# copying conf.sh.dist -# and renaming as below -source ./conf-auth.sh - -starter - - diff --git a/modules/acore/startup-scritps/examples/starter-world.sh b/modules/acore/startup-scritps/examples/starter-world.sh deleted file mode 100644 index 380a57c8e9..0000000000 --- a/modules/acore/startup-scritps/examples/starter-world.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -$PATH_RUNENGINE="" - -source $PATH_RUNENGINE/run-engine - -# you must create your conf -# copying conf.sh.dist -# and renaming as below -source ./conf-world.sh - -starter - - diff --git a/modules/acore/startup-scritps/run-engine b/modules/acore/startup-scritps/run-engine deleted file mode 100644 index 7cecaeb134..0000000000 --- a/modules/acore/startup-scritps/run-engine +++ /dev/null @@ -1,102 +0,0 @@ -export RUN_ENGINE_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# load default conf -if [ -e "$RUN_ENGINE_PATH/conf.dist" ]; then - source "$RUN_ENGINE_PATH/conf.sh.dist" -fi - -function configureFiles() { - TRACE_BEGIN_STRING="SIGSEGV" - TRACE_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_trace.log" - ERR_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_error.log" - SYSLOG="$LOGS_PATH/"$LOG_PREFIX_NAME"_system.log" - SYSERR="$LOGS_PATH/"$LOG_PREFIX_NAME"_system.err" - LINKS_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_crash_links.link" -} - -function checkStatus() { - local ret=1 - # wipe do : destroy old screens + ls - screen -wipe - if screen -ls $1 | grep -q "No Sockets found" - then - return 0 - fi - - local gdbres=$(pgrep -f "gdb -x $GDB --batch $SERVERBIN") - if [[ $GDB_ENABLED -eq 0 && -z $gdbres ]]; then - return 0 - fi - - # - # This is a specific check for Azeroth Core in case of screen failure - # It is possible since same binary file cannot be launched with same configuration file - # This is an extra check - # - local binres=$(pgrep -f "$SERVERBIN -c $CONFIG") - if [ -z $binres ]; then - return 0 - fi - - return 1 -} - -function run() { - echo $1 - if [ ! -z $1 ]; then - local OPTIONS="-A -m -d -S" - if [ ! -z "$SCREEN_OPTIONS" ]; then - OPTIONS=$SCREEN_OPTIONS - fi - - echo "> Starting with screen ( screen $OPTIONS )" - - screen $OPTIONS $1 "$RUN_ENGINE_PATH/starter" $2 $3 "$4" "$5" "$6" $7 - else - $RUN_ENGINE_PATH/starter $2 $3 "$4" "$5" "$6" $7 - fi -} - -function starter() { - cd $BINPATH - - mkdir -p "$LOGS_PATH" - - configureFiles - - run "$SCREEN_NAME" "$SERVERBIN" "$GDB" "$CONFIG" "$SYSLOG" "$SYSERR" "$GDB_ENABLED" -} - - -function restarter() { - cd $BINPATH - - mkdir -p "$LOGS_PATH" - - configureFiles - - if [ ! -f $TRACE_FILE ]; then - touch $TRACE_FILE - fi - - while : - do - if checkStatus $SCREEN_NAME; then - DATE=$(date) - echo "Restarting $SCREEN_NAME Core blizz($DATE)" - if [ $GDB_ENABLED -eq 1 ]; then - echo "GDB enabled" - grep -B 10 -A 1800 "$TRACE_BEGIN_STRING" "$SYSLOG" >> "$TRACE_FILE" - cat "$SYSERR" > "$ERR_FILE" - run "$SCREEN_NAME" "$SERVERBIN" "$GDB" "$CONFIG" "$SYSLOG" "$SYSERR" 1 - fi - - if [ $GDB_ENABLED -eq 0 ]; then - echo "GDB disabled" - run "$SCREEN_NAME" "$SERVERBIN" null "$CONFIG" null null 0 - fi - fi - - sleep 10 - done -} diff --git a/modules/acore/startup-scritps/starter b/modules/acore/startup-scritps/starter deleted file mode 100755 index 2f98ea40f9..0000000000 --- a/modules/acore/startup-scritps/starter +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -GDB_FILE="$2" -CONFIG="$3" -SYSLOG="$4" -SYSERR="$5" -GBD_ENABLED="$6" - -if [ $GBD_ENABLED -eq 1 ]; then - echo "set logging on" > "$GDB_FILE" - echo "set debug timestamp" >> "$GDB_FILE" - echo "run -c $3" >> "$GDB_FILE" - echo "bt" >> "$GDB_FILE" - - [ ! -f "$SYSLOG" ] && touch "$SYSLOG" - [ ! -f "$SYSERR" ] && touch "$SYSERR" - - if [ $WITH_CONSOLE -eq 0 ]; then - gdb -x $GDB_FILE --batch $1 >> "$SYSLOG" 2>> "$SYSERR" - else - echo "> Console enabled" - gdb -x $GDB_FILE --batch $1 > >(tee ${SYSLOG}) 2> >(tee ${SYSERR} >&2) - fi - -elif [ $GBD_ENABLED -eq 0 ]; then - "./$1" -c "$CONFIG" -fi -- cgit v1.2.3