[GH-ISSUE #4720] [Bug]: Can't stop Rust server gracefully #2932

Open
opened 2026-02-27 03:06:22 +03:00 by kerem · 7 comments
Owner

Originally created by @HunterZ on GitHub (Dec 21, 2024).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4720

User story

As a rust server owner, I need LGSM to stop the server via a quit RCON command to trigger a clean save on exit

Game

Rust

Linux distro

Ubuntu 24.04

Command

command: stop

Further information

LGSM's default stopmode for Rust is CTRL+C, which causes a hard shutdown that tends to have nasty side effects like forgetting teams, because the server doesn't get a chance to generate a full save.

Changing stopmode to quit results in failure, apparently because LGSM tries to send it to the server console instead of via RCON.

Relevant log output

rustserver@ubuntultsvm:~$ ./rustserver stop
[ ERROR ] Stopping rustserver: Graceful: sending "quit": FAIL
[  OK  ] Stopping rustserver: LinuxGSM


### Steps to reproduce

1. Configure server for `stopmode=3`
2. `./rustserver start` and wait for server startup to complete
3. `./rustserver stop`
Originally created by @HunterZ on GitHub (Dec 21, 2024). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/4720 ### User story As a rust server owner, I need LGSM to stop the server via a `quit` RCON command to trigger a clean save on exit ### Game Rust ### Linux distro Ubuntu 24.04 ### Command command: stop ### Further information LGSM's default `stopmode` for Rust is CTRL+C, which causes a hard shutdown that tends to have nasty side effects like forgetting teams, because the server doesn't get a chance to generate a full save. Changing `stopmode` to `quit` results in failure, apparently because LGSM tries to send it to the server console instead of via RCON. ### Relevant log output ```shell rustserver@ubuntultsvm:~$ ./rustserver stop [ ERROR ] Stopping rustserver: Graceful: sending "quit": FAIL [ OK ] Stopping rustserver: LinuxGSM ``` ``` ### Steps to reproduce 1. Configure server for `stopmode=3` 2. `./rustserver start` and wait for server startup to complete 3. `./rustserver stop`
Author
Owner

@rychannel commented on GitHub (Mar 12, 2025):

Glad someone submitted this. Kept getting told I was doing it wrong even though I had tried every stop mode I thought made sense.

<!-- gh-comment-id:2718009346 --> @rychannel commented on GitHub (Mar 12, 2025): Glad someone submitted this. Kept getting told I was doing it wrong even though I had tried every stop mode I thought made sense.
Author
Owner

@dgibbs64 commented on GitHub (Mar 12, 2025):

I am unsure on how to resolve this as LinuxGSM does not have RCON access to servers and Rust does not have an interactive console which we somtimes use. Different game servers have very different RCON protocols or none at all which adds a lot of complexity as I would need to add bespoke support for different game servers. Most game servers typically can handle graceful shutdown when CTRL+c or equivalent is triggered.

I only found 1 previous issue highlighting a similar issue but was closed due to inactivity. It would be great to get some input from other Rust admins to see if they also experience a similar issue and how they resolve it. If there are any suggestions I am happy to look at implementing if practical to do so.

<!-- gh-comment-id:2718492542 --> @dgibbs64 commented on GitHub (Mar 12, 2025): I am unsure on how to resolve this as LinuxGSM does not have RCON access to servers and Rust does not have an interactive console which we somtimes use. Different game servers have very different RCON protocols or none at all which adds a lot of complexity as I would need to add bespoke support for different game servers. Most game servers typically can handle graceful shutdown when CTRL+c or equivalent is triggered. I only found 1 previous issue highlighting a similar issue but was closed due to inactivity. It would be great to get some input from other Rust admins to see if they also experience a similar issue and how they resolve it. If there are any suggestions I am happy to look at implementing if practical to do so.
Author
Owner

@rychannel commented on GitHub (Mar 12, 2025):

May need to use an RCON client like this that can run from command line.  I haven’t tried it yet. fieu/phust: Send RCON commands to your Rust server via the command-line ⛏github.comIf LGSM has an option to supply a custom stop command, that could help, maybe? Or try including the above client Sent from my iPhoneOn Mar 12, 2025, at 11:42 AM, Daniel Gibbs @.> wrote:
I am unsure on how to resolve this as LinuxGSM does not have RCON access to servers and Rust does not have an interactive console which we somtimes use. Different game servers have very different RCON protocols or none at all which adds a lot of complexity as I would need to add bespoke support for different game servers. Most game servers typically can handle graceful shutdown when CTRL+c or equivalent is triggered.
I only found 1 previous issue highlighting a similar issue but was closed due to inactivity. It would be great to get some input from other Rust admins to see if they also experience a similar issue and how they resolve it. If there are any suggestions I am happy to look at implementing if practical to do so.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.
>

dgibbs64 left a comment (GameServerManagers/LinuxGSM#4720)
I am unsure on how to resolve this as LinuxGSM does not have RCON access to servers and Rust does not have an interactive console which we somtimes use. Different game servers have very different RCON protocols or none at all which adds a lot of complexity as I would need to add bespoke support for different game servers. Most game servers typically can handle graceful shutdown when CTRL+c or equivalent is triggered.
I only found 1 previous issue highlighting a similar issue but was closed due to inactivity. It would be great to get some input from other Rust admins to see if they also experience a similar issue and how they resolve it. If there are any suggestions I am happy to look at implementing if practical to do so.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

<!-- gh-comment-id:2718532213 --> @rychannel commented on GitHub (Mar 12, 2025): May need to use an RCON client like this that can run from command line.  I haven’t tried it yet. fieu/phust: Send RCON commands to your Rust server via the command-line ⛏github.comIf LGSM has an option to supply a custom stop command, that could help, maybe? Or try including the above client Sent from my iPhoneOn Mar 12, 2025, at 11:42 AM, Daniel Gibbs ***@***.***> wrote: I am unsure on how to resolve this as LinuxGSM does not have RCON access to servers and Rust does not have an interactive console which we somtimes use. Different game servers have very different RCON protocols or none at all which adds a lot of complexity as I would need to add bespoke support for different game servers. Most game servers typically can handle graceful shutdown when CTRL+c or equivalent is triggered. I only found 1 previous issue highlighting a similar issue but was closed due to inactivity. It would be great to get some input from other Rust admins to see if they also experience a similar issue and how they resolve it. If there are any suggestions I am happy to look at implementing if practical to do so.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***> dgibbs64 left a comment (GameServerManagers/LinuxGSM#4720) I am unsure on how to resolve this as LinuxGSM does not have RCON access to servers and Rust does not have an interactive console which we somtimes use. Different game servers have very different RCON protocols or none at all which adds a lot of complexity as I would need to add bespoke support for different game servers. Most game servers typically can handle graceful shutdown when CTRL+c or equivalent is triggered. I only found 1 previous issue highlighting a similar issue but was closed due to inactivity. It would be great to get some input from other Rust admins to see if they also experience a similar issue and how they resolve it. If there are any suggestions I am happy to look at implementing if practical to do so. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
Author
Owner

@HunterZ commented on GitHub (Mar 12, 2025):

Rust's RCON protocol is pretty simple. I've been able to write C++ apps that talk with it just by using a websocket library combined with a JSON library.

<!-- gh-comment-id:2719120244 --> @HunterZ commented on GitHub (Mar 12, 2025): Rust's RCON protocol is pretty simple. I've been able to write C++ apps that talk with it just by using a websocket library combined with a JSON library.
Author
Owner

@atomy commented on GitHub (Apr 7, 2025):

I have a bash script using https://github.com/fieu/phust for rcon commands, it requires PHP though.
https://gist.github.com/atomy/9460458a319d32958f59736585b3ccd5

I am wondering how I can use it for graceful shutdown, any place where I can hook that in? Maybe create my own stopmode or something?

<!-- gh-comment-id:2784789639 --> @atomy commented on GitHub (Apr 7, 2025): I have a bash script using https://github.com/fieu/phust for rcon commands, it requires PHP though. https://gist.github.com/atomy/9460458a319d32958f59736585b3ccd5 I am wondering how I can use it for graceful shutdown, any place where I can hook that in? Maybe create my own stopmode or something?
Author
Owner

@atomy commented on GitHub (Apr 8, 2025):

So I added another stopmode and used my script, I tested it, it works quite well.

https://github.com/atomy/LinuxGSM/pull/1/files

However, the rcon tool I am using is not that great, it should probably be changed to https://github.com/gorcon/rcon-cli
Also this issue is relevant here if not even a dupe: https://github.com/GameServerManagers/LinuxGSM/issues/4419

<!-- gh-comment-id:2785015392 --> @atomy commented on GitHub (Apr 8, 2025): So I added another stopmode and used my script, I tested it, it works quite well. https://github.com/atomy/LinuxGSM/pull/1/files However, the rcon tool I am using is not that great, it should probably be changed to https://github.com/gorcon/rcon-cli Also this issue is relevant here if not even a dupe: https://github.com/GameServerManagers/LinuxGSM/issues/4419
Author
Owner

@dgibbs64 commented on GitHub (Jun 21, 2025):

Having a quick look it appears that this tool might be a good option to solve this issue. However a mechanism to pull in this dependency would need to be created https://github.com/gorcon/rcon-cli

<!-- gh-comment-id:2993705701 --> @dgibbs64 commented on GitHub (Jun 21, 2025): Having a quick look it appears that this tool might be a good option to solve this issue. However a mechanism to pull in this dependency would need to be created https://github.com/gorcon/rcon-cli
Sign in to join this conversation.
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/LinuxGSM#2932
No description provided.