Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[Bug]: monitor does not detect updates started with the `u` short alias

Closed Beginner friendly
#4,997 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash
Domain
cli

Research direction

The check lives in fn_monitor_check_update in lgsm/modules/command_monitor.sh, around line 168. The alias list is defined in core_getopt.sh (cmd_update="u;update"), and the process match in that function only covers the long names. Reproduce by running fn_monitor_check_update with update.lock present while a process whose command line is /bin/bash ./testserver u is running. Done when u gets the same SKIP result as update and the existing update, validate and restart checks still pass.

Written by the indexing model from the issue text.

Description

command: monitor command: update info: steamcmd reproducible: always severity: medium type: bug
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
  1. Install any SteamCMD game server (e.g. vhserver) and start it, so the monitoring lockfile exists.
  2. Run ./vhserver u while an update is available, so the server gets stopped for the update.
  3. While SteamCMD is still downloading, run ./vhserver monitor (or let the monitor cron job run).
  4. Monitor reports Checking session: FAIL, sends a monitor-session alert and restarts the server during the update.
  5. Repeat with ./vhserver update: monitor reports Checking update: LinuxGSM is updating the game server and exits.

🤖 Generated with Claude Code

Dominant language
Shell
Stars
4.9k
Forks
863
Avg merge
1d 16h
Merged PRs (30d)
45

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GameServerManagers/LinuxGSM

All issues in GameServerManagers/LinuxGSM

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.