Преглед изворни кода

fix(update): continue starting the server after updateonstart applies an update (#5056)

With updateonstart enabled, command_start.sh sets exitbypass so that
command_update.sh returns to it. When an update was available and the
server was stopped, the update modules ran unset exitbypass after the
download, so the final core_exit.sh in command_update.sh exited the
whole script and the server was never started. This affected start and
restart for every update module, not just SteamCMD.

command_update.sh now records the caller's exitbypass on entry and
restores it before its final core_exit.sh, so a caller that asked to
continue always gets control back.

Tested on a test server (hl2dmserver, develop modules):
- start and restart with an update available: server now starts
  (was left stopped with exit code 0 before the fix)
- start and restart with no update: server starts
- start and restart with a failed SteamCMD download: server starts on
  the installed build
- update while running, while stopped, with no update and with a
  failed download: unchanged behaviour

Fixes #4415
Fixes #4703
Daniel Gibbs пре 3 дана
родитељ
комит
497e76b7cf
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      lgsm/modules/command_update.sh

+ 2 - 0
lgsm/modules/command_update.sh

@@ -9,6 +9,7 @@ commandname="UPDATE"
 commandaction="Updating"
 moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
 fn_firstcommand_set
+updateexitbypass="${exitbypass}"
 
 fn_print_dots ""
 check.sh
@@ -59,4 +60,5 @@ fi
 # remove update lockfile.
 rm -f "${lockdir:?}/update.lock"
 
+exitbypass="${updateexitbypass}"
 core_exit.sh