[Bug]: 7 Days to Die graceful stop always fails — telnetpass/telnetpassword variable mismatch in info_game.sh
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
Research direction
Start in lgsm/modules/info_game.sh at fn_info_game_sdtd(), then compare its TelnetPassword assignments with the consumers in command_stop.sh and info_messages.sh. Rename the two remaining telnetpass occurrences using word-boundary matching, then run ./sdtdserver details and ./sdtdserver stop with TelnetPassword enabled; done means the password and configured address appear and graceful shutdown authenticates.
Written by the indexing model from the issue text.
Description
Severity
severity: high
Reproducibility
reproducible: always
Regression
regression: yes
Affects latest release
latest-release: yes
User story
As a 7 Days to Die server admin, I want LinuxGSM to shut the server down gracefully over telnet so that the world save is flushed cleanly instead of the server being killed by tmux.
Script name
sdtdserver
Game
7 Days to Die
Linux distro
Debian 13
Command
command: stop
Expected behavior
fn_info_game_sdtd() reads TelnetPassword from the server config into ${telnetpassword} — the variable that command_stop.sh and info_messages.sh actually consume. Graceful telnet shutdown authenticates and completes.
Actual behavior
fn_info_game_sdtd() stores the password in ${telnetpass}, but every consumer reads ${telnetpassword}, which stays empty.
Two things break:
-
Graceful shutdown never authenticates.
command_stop.sh:115—[ -z "${telnetpassword}" ] || [ "${telnetpassword}" == "NOT SET" ]is always true, so the expect block that sends no password is used. On any server withTelnetPasswordset the login fails, graceful shutdown fails, and LinuxGSM falls back totmux kill— the path its own comment describes as "this risks loss of world save". -
Telnet IP is pinned to localhost.
info_game.sh:1980—if [ -z "${telnetpassword}" ]; then telnetip="127.0.0.1"; fialways fires, regardless of the configured IP.
info_messages.sh:1497 also prints an empty Telnet password in details — the quickest way to observe the bug without stopping a server.
Further information
Root cause: a partial variable rename.
Up to and including v24.2.4, info_game.sh and command_stop.sh both used ${telnetpass} and were consistent. v24.3.0 renamed the consumers (command_stop.sh, info_messages.sh) to ${telnetpassword} but left the producer in info_game.sh as ${telnetpass}.
Confirmed present in v24.3.0 through v26.2.0, and in current master and develop.
Note that info_game.sh:1980 already reads ${telnetpassword} — the mismatch is internal to the same function, which suggests the rename was simply incomplete rather than intentional.
Fix
Rename the two remaining occurrences in fn_info_game_sdtd():
--- a/lgsm/modules/info_game.sh
+++ b/lgsm/modules/info_game.sh
@@ -1963 +1963 @@
- fn_info_game_xml "telnetpass" "/ServerSettings/property[@name='TelnetPassword']/@value"
+ fn_info_game_xml "telnetpassword" "/ServerSettings/property[@name='TelnetPassword']/@value"
@@ -1983 +1983 @@
- telnetpass="${telnetpass:-"NOT SET"}"
+ telnetpassword="${telnetpassword:-"NOT SET"}"
The existing ordering stays correct once renamed: the -z check on line 1980 runs before the "NOT SET" default on line 1983, and command_stop.sh handles both the empty and "NOT SET" cases.
Use word-boundary matching when patching — telnetpassword contains telnetpass as a prefix:
sed -i -E 's/\btelnetpass\b/telnetpassword/g' lgsm/modules/info_game.sh
grep -w telnetpass across lgsm/modules/ returns no other hits, so these are the only two call sites.
Verified on two independent 7 Days to Die installs — LinuxGSM v26.2.0, Debian 13, 7DTD dedicated buildid 24911252.
Pre-checks
- I ran update and validate before reporting this issue.
Relevant log output
# TelnetPassword is set in the server config:
$ grep TelnetPassword serverfiles/sdtdserver.xml
<property name="TelnetPassword" value="REDACTED"/>
# BEFORE — stock v26.2.0 info_game.sh
$ ./sdtdserver details
Telnet enabled: true
Telnet address: 127.0.0.1 8091
Telnet password:
# AFTER — the two-line rename above applied
$ ./sdtdserver details
Telnet enabled: true
Telnet address: 203.0.113.10 8091
Telnet password: REDACTED
# Variable state in stock v26.2.0 info_game.sh (producer vs consumers)
$ grep -n telnetpass lgsm/modules/info_game.sh
1963: fn_info_game_xml "telnetpass" "/ServerSettings/property[@name='TelnetPassword']/@value"
1980: if [ -z "${telnetpassword}" ]; then
1983: telnetpass="${telnetpass:-"NOT SET"}"
$ grep -n telnetpassword lgsm/modules/command_stop.sh
115: if [ -z "${telnetpassword}" ] || [ "${telnetpassword}" == "NOT SET" ]; then
137: "password:" { send "'"${telnetpassword}"'\r" }
Steps to reproduce
- Install
sdtdserveron LinuxGSM v24.3.0 or newer (reproduced on v26.2.0). - Set a non-empty
TelnetPasswordandTelnetEnabled="true"in the server config. - Run
./sdtdserver detailsand look at the 7 Days To Die Telnet block — Telnet password is blank and Telnet address is forced to127.0.0.1. - Start the server, then run
./sdtdserver stop— graceful telnet shutdown fails to authenticate and LinuxGSM falls back to atmuxkill. - Apply the two-line rename in
fn_info_game_sdtd()and repeat steps 3–4 — the password is read and graceful shutdown completes.
- Dominant language
- Shell
- Stars
- 4.9k
- Forks
- 863
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GameServerManagers/LinuxGSM
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
GameServerManagers/LinuxGSM#4956 ·
-
command: start distro: Ubuntu engine: unity3d game: Valheim regression: yes reproducible: always severity: low type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
GameServerManagers/LinuxGSM#4930 · 1 comment ·
-
command: install game: Counter-Strike: Global Offensive info: steamcmd type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
GameServerManagers/LinuxGSM#4883 · 10 comments · 1 reaction ·
-
command: console command: install command: start command: update command: update-lgsm distro: Debian info: dependency info: query info: tmux type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
GameServerManagers/LinuxGSM#4818 · 3 comments ·
-
command: fast-dl command: install distro: Ubuntu engine: source game: Empires Mod type: bug
Difficulty 1/5 Under an hour Newbie friendliness 76/100
GameServerManagers/LinuxGSM#3992 · 1 comment · 1 reaction ·
All issues in GameServerManagers/LinuxGSM
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·