Repository navigation
Conversation
fn_monitor_check_starting and fn_monitor_check_stopping exit monitor when the starting or stopping lockfile exists and a start or stop process is running. Besides the long commands they checked for "s", which is the sponsor alias, not the "st" and "sp" aliases of start and stop. Since pgrep matches exactly, "./gameserver st" and "./gameserver sp" were not detected and monitor could restart a server that was being started or stopped, while "./gameserver s" made monitor skip its run. Fixes GameServerManagers#4999 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
I have the 5000th PR! 🥳 |
9 of 16 tasks
Contributor
Author
|
No problem, and thank you! |
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_startingandfn_monitor_check_stoppinginlgsm/modules/command_monitor.shmake monitor exit when${selfname}-starting.lockor${selfname}-stopping.lockexists and a start or stop process is running. They find that process withpgrep -fcxagainststart/stopands. Butsis the sponsor alias.core_getopt.shdefines the start and stop commands ascmd_start=("st;start" ...)andcmd_stop=("sp;stop" ...).Because
pgrep -xneeds an exact match:./gameserver stand./gameserver spare not detected. Duringspthe monitoring lockfile stays until the server has shut down, so monitor goes on to the session and query checks, fails them on the server that is going down, sends an alert and runscommand_restart.sh. The same can happen whilestbrings a crashed server back../gameserver s(sponsor) makes monitor skip its run while a starting or stopping lockfile younger than 5 minutes exists.sused to work as a prefix before 8cd16ac switched these checks to exact matching. This PR checks forstinstead ofsinfn_monitor_check_startingand forspinstead ofsinfn_monitor_check_stopping. Onlylgsm/modules/command_monitor.shis changed.Fixes #4999
Type of change
Testing
Please list the exact validation you performed and the outcome.
Commands/tests run:
fn_monitor_check_startingandfn_monitor_check_stoppingfrom bothdevelop(28b1d67) and this branch, stubbed the print/log helpers andcore_exit.sh, and ran them with the matching lockfile present while a real/bin/bash ./testserver <command>process was running./bin/bash ./testserver <command>running forsponsor,sd,sk, the other of start/stop, andst extra/sp extra.bash -n lgsm/modules/command_monitor.shandshellcheck0.11.0 with the repository's.shellcheckrc.Result:
developstartsts(sponsor)sponsor,sp,stop,sd,sk,st extrastopsps(sponsor)sponsor,st,start,sd,sk,sp extrast/spNo
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
pgreppatterns change fromstost/sp; the lockfile checks, the stale lockfile handling and the other monitor checks 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