Repository navigation
Conversation
fn_monitor_check_update skips monitoring when update.lock exists and an update process is running, but it did not check for the "u" alias of the update command. While "./gameserver u" stopped the server for an update, monitor saw no update process, reported the session as failed and restarted the server during the update. Fixes GameServerManagers#4997 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
fn_monitor_check_updateinlgsm/modules/command_monitor.shskips monitoring whenlock/update.lockexists and an update process is running. It finds the update process withpgrep -fcxagainst the command linesupdate,validate,v,force-update,fu,update-restartandur, but notu, althoughcore_getopt.shdefines the update command ascmd_update=("u;update" ...).Because
pgrep -xneeds an exact match, an update started with./gameserver uis not found and monitor carries on. During a SteamCMD update that stops the server, the stop keeps${selfname}-monitoring.lock(the first command is UPDATE, not STOP). So the next monitor run reportsChecking session: FAIL, sends amonitor-sessionalert and runscommand_restart.shwhile SteamCMD is still updating the server.This PR adds the missing
"/bin/bash ./${selfname} u"check next to theupdatecheck. Onlylgsm/modules/command_monitor.shis changed.Fixes #4997
Type of change
Testing
Please list the exact validation you performed and the outcome.
Commands/tests run:
fn_monitor_check_updatefrom bothdevelop(28b1d67) and this branch, stubbed the print/log helpers andcore_exit.sh, and ran it withupdate.lockpresent while a real/bin/bash ./testserver <command>process was running, for every update related command.update.lockmissing./bin/bash ./testserver ul,update-lgsm,ufandu extrarunning.bash -n lgsm/modules/command_monitor.shandshellcheck0.11.0 with the repository's.shellcheckrc.Result:
developupdateuvalidate,v,force-update,fu,update-restart,ururunning, no lockul,update-lgsm,uf,u extrarunning, lock presentNo
bash -nor shellcheck findings.Environment used (distro/version): Ubuntu 22.04.5 LTS, bash 5.1.16, procps-ng 3.3.17.
Risk and rollback
pgrepcheck in an existing condition; other commands and the stale lockfile handling are unchanged.Breaking changes
Documentation impact
Checklist
PR will not be merged until all steps are complete.
Documentation
If documentation does need updating either update it by creating a PR (preferred) or request a documentation update.
Thank you for your Pull Request!
🤖 Generated with Claude Code