[Bug]: cs2server ignores the GSLT entered during install

Open Beginner friendly
#5,106 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@borzaka is already working on this.

Since Oct 26, 2026.

  • #5107 by @borzaka — open

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, shell
Domain
cli, game-dev

Research direction

Read lgsm/config-default/config-lgsm/cs2server/_default.cfg around the startparameters definition and compare it with the GSLT handling in other Source server configs. Add the token argument after +exec ${selfname}.cfg, as the reported tests show the order matters. Done when a fresh install passes the entered token to the server and its console logs into the Steam gameserver account with that token.

Written by the indexing model from the issue text.

Description

command: install command: start distro: Debian engine: source2 game: Counter-Strike 2 regression: yes reproducible: always severity: high type: bug
Severity

severity: high

Reproducibility

reproducible: always

Regression

regression: yes

Affects latest release

latest-release: yes

User story

As a CS2 server administrator, I want the GSLT I enter during install to be used by the server, so that players can join it from the internet.

Script name

cs2server

Game

Counter-Strike 2

Linux distro

Debian 12

Command

command: install, command: start

Expected behavior

The GSLT entered at the GSLT TOKEN: prompt during install (stored as gslt in lgsm/config-lgsm/cs2server/cs2server.cfg) is passed to the server, and the console shows:

Logging into Steam gameserver account with logon token 'XXXXXXXX...'
Actual behavior

The token is stored but never reaches the server. The server logs into an anonymous game server account and only accepts LAN connections:

*  No Steam account token was specified.           *
*  Logging into anonymous game server account.     *
*  Connections will be restricted to LAN only.     *
Further information

install_gslt.sh asks for the token, writes it to lgsm/config-lgsm/cs2server/cs2server.cfg and tells the user that the GSLT can be changed there. But the cs2server startparameters in lgsm/config-default/config-lgsm/cs2server/_default.cfg (line 24) never uses ${gslt}:

startparameters="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -authkey ${wsapikey} +exec ${selfname}.cfg"

No module passes the token on either: sv_setsteamaccount does not appear anywhere in lgsm/modules/. The other 11 Source servers with a GSLT (csgo, css, tf2, gmod, ...) all have +sv_setsteamaccount ${gslt} in their startparameters.

How it got here:

  • f33bfdf4 (2023-10-27): cs2server started with +sv_setsteamaccount ${gslt} in its start parameters.
  • 2fff61f4 (#4405, 2024-01-19): the parameters, including gslt, were moved into the game server config. The CS2 server.cfg template in Game-Server-Configs has an sv_setsteamaccount "" line. #4457 reported the missing parameters and was closed with "The CS2 start parameters were merged into the config file".
  • cac8b81a (2024-10-06): gslt="" was added back to the cs2server config, so the installer prompts for the token again (command_install.sh checks [ -v gslt ]). But it was not added back to startparameters, so the token entered at the prompt is ignored.

Today the token only works if it is also typed by hand into the sv_setsteamaccount line of serverfiles/game/csgo/cfg/cs2server.cfg. The installer does not mention this.

I tested where the parameter can go (fresh cs2server install, startparameters overridden in the instance config):

Test Token location Order Result
A LinuxGSM gslt +exec ${selfname}.cfg +sv_setsteamaccount ${gslt} logon token
B LinuxGSM gslt +sv_setsteamaccount ${gslt} +exec ${selfname}.cfg anonymous
C game server config only, gslt="" +exec ${selfname}.cfg +sv_setsteamaccount ${gslt} Usage: sv_setsteamaccount <login_token>, then logon token

B fails because the game server config template sets sv_setsteamaccount "", which clears a token set before it. Test A also shows that the Steam login happens after all command-line commands, even though the game server config contains a map line. Test C shows that an empty gslt only prints the usage line, so servers that set the token in the game server config keep working.

Suggested fix: add +sv_setsteamaccount ${gslt} after +exec ${selfname}.cfg. I will open a PR for it.

Pre-checks
  • I ran update and validate before reporting this issue.

Reproduced on a fresh install on Debian 12.15 (bookworm) x86_64.

Relevant log output
$ grep -A8 "SteamGameServer_Init" log/console/cs2server-console.log
SteamGameServer_Init() OK, logging on to Steam
****************************************************
*                                                  *
*  No Steam account token was specified.           *
*  Logging into anonymous game server account.     *
*  Connections will be restricted to LAN only.     *
*                                                  *
*  To create a game server account go to           *
*  http://steamcommunity.com/dev/managegameservers *
Steps to reproduce
  1. Run ./linuxgsm.sh cs2server and ./cs2server install, and enter a valid GSLT at the GSLT TOKEN: prompt.
  2. Check that lgsm/config-lgsm/cs2server/cs2server.cfg contains gslt="<token>".
  3. Run ./cs2server start.
  4. Run grep -E "logon token|anonymous game server" log/console/cs2server-console.log: the anonymous login banner is shown.
  5. Run ./cs2server details: the command-line parameters do not contain +sv_setsteamaccount.

🤖 Generated with Claude Code

Dominant language
Shell
Stars
4.9k
Forks
870
Avg merge
18h 44m
Merged PRs (30d)
148

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.