[Bug]: monitor does not detect updates started with the `u` short alias
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- bash
- Ambito
- cli
Direzione di ricerca
Il controllo si trova in fn_monitor_check_update in lgsm/modules/command_monitor.sh, intorno alla riga 168. La lista degli alias è definita in core_getopt.sh (cmd_update="u;update"), e la corrispondenza dei processi in quella funzione copre solo i nomi lunghi. Per riprodurre, eseguire fn_monitor_check_update con update.lock presente mentre è in esecuzione un processo la cui riga di comando è /bin/bash ./testserver u. È completato quando u ottiene lo stesso risultato SKIP di update e i controlli esistenti di update, validate e restart continuano a passare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Severity
severity: medium
Reproducibility
reproducible: always
Regression
regression: no
Affects latest release
latest-release: yes
User story
As a game server administrator, I want monitor to leave my server alone while an update started with ./gameserver u is running, so that it does not restart the server in the middle of the update.
Script name
Any (e.g. vhserver)
Game
Any (not game specific)
Linux distro
Other
Command
command: monitor, command: update
Expected behavior
While ./gameserver u is running and lock/update.lock exists, monitor prints Checking update: LinuxGSM is updating the game server and exits, as it already does for ./gameserver update.
Actual behavior
Monitor does not detect the update and continues. Because the update has stopped the server, fn_monitor_check_session reports Checking session: FAIL, sends a monitor-session alert and runs command_restart.sh, which starts the server while SteamCMD is still updating it.
Further information
core_getopt.sh defines the update command as cmd_update=("u;update" ...), so ./gameserver u and ./gameserver update run the same update.
fn_monitor_check_update in lgsm/modules/command_monitor.sh (line 168) only skips monitoring when update.lock exists and an update process is found with pgrep -fcx. It checks the command lines for update, validate, v, force-update, fu, update-restart and ur, but not for u. pgrep -x needs an exact match, so /bin/bash ./gameserver u is not found, pgrep returns 0 and the update lock is ignored.
During a SteamCMD update that has to stop the server, update_steamcmd.sh calls command_stop.sh with exitbypass=1. The stop keeps ${selfname}-monitoring.lock because the first command is UPDATE, not STOP. The next monitor run (cron, typically every 5 minutes) therefore gets past the lockfile check and restarts the server.
The u alias has been missing since this check was added in 9d699ee3 (2023).
Suggested fix: add || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} u")" != "0" to the condition. I will open a PR for it.
Pre-checks
- I ran update and validate before reporting this issue.
Found by reading the code on the current develop branch (28b1d67d) and reproduced with the module function itself, see the steps and output below.
Relevant log output
# fn_monitor_check_update from develop (28b1d67d), update.lock present,
# while "/bin/bash ./testserver <command>" is running:
command result
update SKIP (update detected)
u CONTINUE (monitor proceeds) <-- bug
validate SKIP (update detected)
v SKIP (update detected)
force-update SKIP (update detected)
fu SKIP (update detected)
update-restart SKIP (update detected)
ur SKIP (update detected)
Steps to reproduce
- Install any SteamCMD game server (e.g.
vhserver) and start it, so the monitoring lockfile exists. - Run
./vhserver uwhile an update is available, so the server gets stopped for the update. - While SteamCMD is still downloading, run
./vhserver monitor(or let the monitor cron job run). - Monitor reports
Checking session: FAIL, sends amonitor-sessionalert and restarts the server during the update. - Repeat with
./vhserver update: monitor reportsChecking update: LinuxGSM is updating the game serverand exits.
🤖 Generated with Claude Code
- Lingua principale
- Shell
- Stelle
- 4.9k
- Fork
- 870
- Merge medio
- 20h 36m
- PR unite (30g)
- 105
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GameServerManagers/LinuxGSM
-
type: bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
GameServerManagers/LinuxGSM#5048 ·
I maintainer di solito rispondono entro 1 giorno
-
engine: unity3d engine: unreal4 Epic game: 7 Days to Die game: ARK: Survival Evolved game: Rust info: dependency type: feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
GameServerManagers/LinuxGSM#5047 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
command: monitor type: feature
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
GameServerManagers/LinuxGSM#4995 ·
I maintainer di solito rispondono entro 1 giorno
-
feat(core): report a clear error when the configured branch doesn't existForse già presa @dgibbs64 l’ha presa 4 giorni fa. Apertatype: feature
Difficoltà 3/5 Mezza giornata Idoneità per principianti 45/100
GameServerManagers/LinuxGSM#4994 ·
I maintainer di solito rispondono entro 1 giorno
-
command: console distro: Debian info: website regression: yes reproducible: always severity: medium type: bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
GameServerManagers/LinuxGSM#4962 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di GameServerManagers/LinuxGSM
Issue simili
-
bug lompi security sev-9
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
gdsa opencode: keep-alive cleanup trap fails with 'keepalive_pid: unbound variable'Forse già presa @darribas l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
-
icon request
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100