[Bug]: A failed command exits with 0 when core_exit.sh is downloaded on exit
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #5192 来自 @borzaka —— 已合并
评估
调研方向
Read core_modules.sh and core_dl.sh, focusing on core_exit.sh(), fn_fetch_module, and fn_fetch_file around the local exitcode declaration. Reproduce with a fresh instance and the reported start command inside tmux, then compare its exit code before and after core_exit.sh is present. Done means the first failing run returns its original nonzero code; linked pull request #5192 is merged.
由索引模型根据 Issue 内容生成。
描述
Severity
severity: low
Reproducibility
reproducible: always
Regression
regression: no
Affects latest release
latest-release: yes
User story
As a server admin who runs LinuxGSM from scripts or cron, I want a failed command to return a non-zero exit code on a new instance too, so that the failure is not reported as success.
Script name
ts3server (any server is affected)
Game
Teamspeak 3
Linux distro
Debian 13
Command
command: start
Expected behavior
The command exits with the code it set, as it does on later runs (1 for the tmuxception error below).
Actual behavior
If lgsm/modules/core_exit.sh has not been downloaded yet, it is downloaded on exit and the command exits with 0. The same command exits with 1 once the file exists.
Further information
core_exit.sh() in core_modules.sh loads the module with fn_fetch_module, and fn_fetch_file (core_dl.sh) sources it inside its own function. When the file is missing, fn_fetch_file first declares local exitcode="" (line 505), which the curl result and fn_script_log_pass "Downloading ..." set to 0, so core_exit.sh exits with that local instead of the caller's code. Once the file exists the download branch is skipped, so only the exit that downloads core_exit.sh is affected, usually the first failing command on a new instance. The pattern is already in v21.3.2; #4159 only changed local exitcode=$? to local exitcode="". A fix is to download core_exit.sh without running it, keep exitcode, and then load it as before. Related but different exit code fixes: #5060, #5109, #5113.
Pre-checks
- I ran update and validate before reporting this issue.
Not run: found by code review and reproduced on a new develop instance, which has nothing to update or validate yet.
Relevant log output
# New ts3server instance from develop (11103431), Debian 13 (WSL2), run inside a tmux session.
$ ./ts3server start; echo $?
[ FAIL ] Starting ts3server: tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session.
...
fetching GitHub [ core_exit.sh ] ... OK
0
$ ./ts3server start; echo $?
[ FAIL ] Starting ts3server: tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session.
...
1
Steps to reproduce
- Create a new instance:
curl -Lo linuxgsm.sh https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/develop/linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh ts3server. - Inside a tmux session, run
LGSM_GITHUBBRANCH=develop ./ts3server start; echo $?. It fails with the tmuxception error, fetchescore_exit.shlast and prints 0. - Run the same command again. It prints 1.
🤖 Generated with Claude Code
- 主要语言
- Shell
- 星标
- 4.9k
- 派生
- 870
- 平均合并
- 18 小时 44 分钟
- 30 天内合并 PR
- 148
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GameServerManagers/LinuxGSM 的其他 Issue
-
command: start distro: Debian engine: null game: Teamspeak 3 reproducible: always severity: low type: bug
难度 2/5 1-3 小时 新手友好度 76/100
GameServerManagers/LinuxGSM#5193 ·
维护者通常 1 天内回复
-
command: start engine: unreal4 game: The Front reproducible: always severity: medium type: bug
难度 1/5 1 小时以内 新手友好度 86/100
GameServerManagers/LinuxGSM#5185 ·
维护者通常 1 天内回复
-
bug(ins): server fails to start, srcds_run has CRLF line endings and needs bash可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭distro: Ubuntu engine: source game: Insurgency status: fixed in develop
难度 2/5 1-3 小时 新手友好度 72/100
GameServerManagers/LinuxGSM#5153 ·
维护者通常 1 天内回复
-
[Bug]: cs2server ignores the GSLT entered during install可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭command: install command: start distro: Debian engine: source2 game: Counter-Strike 2 regression: yes reproducible: always severity: high type: bug
难度 2/5 1-3 小时 新手友好度 82/100
GameServerManagers/LinuxGSM#5106 ·
维护者通常 1 天内回复
-
[Bug]: install passes a leftover forcedl value instead of each server's force setting可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭command: install info: steamcmd reproducible: unable severity: low status: fixed in develop type: bug
难度 1/5 1 小时以内 新手友好度 25/100
GameServerManagers/LinuxGSM#5189 ·
维护者通常 1 天内回复
查看 GameServerManagers/LinuxGSM 的全部 Issue
相似的 Issue
-
Isha Narula未关闭
难度 1/5 1 小时以内 新手友好度 72/100
dataplat/DataSpeakers#178 ·
-
[BUG] mo clean deletes Cypress test runner binaries in ~/Library/Caches/Cypress可能已有人在做 @viniciusdsandrade 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
-
enhancement security severity:low
难度 2/5 1-3 小时 新手友好度 83/100
Battle-Cattle/BCUK-Bot-4#959 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
mattabate/life-distributable#153 ·
维护者通常 1 天内回复