Tweak the stop functions to not mess up the mirrors

Otherwise it synchronizes the mirror image during shutdown ...
This commit is contained in:
Wilco de Boer 2017-02-18 17:36:28 +01:00
parent 394801882f
commit fc7a24f655

14
msctl
View File

@ -1107,11 +1107,14 @@ start() {
# @param 1 The world server to stop. # @param 1 The world server to stop.
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
stop() { stop() {
local WORLD NUM # Tell the server to stop.
sendCommand $1 "stop" sendCommand $1 "stop"
sendCommand $1 "end" sendCommand $1 "end"
# Synchronize the mirror image of the world prior to closing, if # Wait for the server to shut down.
# required. while serverRunning $1; do
sleep 1
done;
# Synchronize the mirror image of the world prior to closing, if required.
if [ $ENABLE_MIRROR -eq 1 ] && [ -L "$WORLDS_LOCATION/$1/$1" ] && [ -d "$MIRROR_PATH/$1" ]; then if [ $ENABLE_MIRROR -eq 1 ] && [ -L "$WORLDS_LOCATION/$1/$1" ] && [ -d "$MIRROR_PATH/$1" ]; then
syncMirrorImage $1 syncMirrorImage $1
# Remove the symlink to the world-file mirror image. # Remove the symlink to the world-file mirror image.
@ -1132,10 +1135,13 @@ stop() {
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
forceStop() { forceStop() {
# Try to stop the server cleanly first. # Try to stop the server cleanly first.
stop "$1" sendCommand $1 "stop"
sendCommand $1 "end"
sleep 10 sleep 10
# Kill the process id of the world server. # Kill the process id of the world server.
kill -9 $(getJavaPID "$1") > /dev/null 2>&1 kill -9 $(getJavaPID "$1") > /dev/null 2>&1
# Properly clean up.
stop $1
} }
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------