[GH-ISSUE #941] [TF2] Not catching 'quit' or '_restart" #756

Closed
opened 2026-02-27 02:53:18 +03:00 by kerem · 14 comments
Owner

Originally created by @Luc1f3rUK on GitHub (Jul 24, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/941

I've noticed today that the script doesn't seem to be catching the 'quit' or '_restart' commands.
This is a big issue as I have all my servers restart at 2AM to prevent performance hitches.

If you run any of those commands, the server just shuts down and the tmux session ends.

Any help would be appreciated.
Thanks,
Ryan.

Originally created by @Luc1f3rUK on GitHub (Jul 24, 2016). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/941 I've noticed today that the script doesn't seem to be catching the 'quit' or '_restart' commands. This is a big issue as I have all my servers restart at 2AM to prevent performance hitches. If you run any of those commands, the server just shuts down and the tmux session ends. Any help would be appreciated. Thanks, Ryan.
kerem closed this issue 2026-02-27 02:53:19 +03:00
Author
Owner

@UltimateByte commented on GitHub (Jul 24, 2016):

Do you mean ./tf2server restart does not work ?

<!-- gh-comment-id:234786528 --> @UltimateByte commented on GitHub (Jul 24, 2016): Do you mean `./tf2server restart` does not work ?
Author
Owner

@UltimateByte commented on GitHub (Jul 24, 2016):

You're trying to restart from the tmux session aka console ?
Maybe some read would help https://github.com/dgibbs64/linuxgsm/wiki/Start-Stop-Restart-commands

<!-- gh-comment-id:234786640 --> @UltimateByte commented on GitHub (Jul 24, 2016): You're trying to restart from the tmux session aka console ? Maybe some read would help https://github.com/dgibbs64/linuxgsm/wiki/Start-Stop-Restart-commands
Author
Owner

@Luc1f3rUK commented on GitHub (Jul 24, 2016):

@UltimateByte Yeah. From within the console.
The script used to catch when this happened, kept the tmux session open then started the server back up, Doesn't seem to be doing it anymore.

<!-- gh-comment-id:234786706 --> @Luc1f3rUK commented on GitHub (Jul 24, 2016): @UltimateByte Yeah. From within the console. The script _used to_ catch when this happened, kept the tmux session open then started the server back up, Doesn't seem to be doing it anymore.
Author
Owner

@UltimateByte commented on GitHub (Jul 24, 2016):

It happens if for some reason there is already a typed text in your console as a "stop" or "restart" command from LGSM will try to input "quit" to the server's console.

<!-- gh-comment-id:234787410 --> @UltimateByte commented on GitHub (Jul 24, 2016): It happens if for some reason there is already a typed text in your console as a "stop" or "restart" command from LGSM will try to input "quit" to the server's console.
Author
Owner

@UltimateByte commented on GitHub (Jul 24, 2016):

So can we consider this as solved ?

<!-- gh-comment-id:234790769 --> @UltimateByte commented on GitHub (Jul 24, 2016): So can we consider this as solved ?
Author
Owner

@Luc1f3rUK commented on GitHub (Jul 24, 2016):

No.
The script isn't catching the restart command. This has happened every time I tried it (after starting the server back up from a quit).
It is a script related issue.

When you type 'quit' in console, the script is supposed to keep the tmux session open then restart the server. It's the crash protection. If the server crashes, it won't come back up.

I have a SourceMod plugin that executes _restart in console, but the srcds instance within tmux isn't restarted, it quits. If it were working properly, the console wouldn't close and the server would say "Server restarting in 10 seconds".

That's the issue.

<!-- gh-comment-id:234801586 --> @Luc1f3rUK commented on GitHub (Jul 24, 2016): No. The script isn't catching the restart command. This has happened every time I tried it (after starting the server back up from a quit). It is a script related issue. When you type 'quit' in console, the script is supposed to keep the tmux session open then restart the server. It's the crash protection. If the server crashes, it won't come back up. I have a SourceMod plugin that executes _restart in console, but the srcds instance within tmux isn't restarted, it quits. If it were working properly, the console wouldn't close and the server would say "Server restarting in 10 seconds". That's the issue.
Author
Owner

@Luc1f3rUK commented on GitHub (Jul 24, 2016):

I run 8 gameservers on one Linux box, but under different users. (tf2server thru 8)
tf2server (1) does this correctly:
https://gyazo.com/06c7975c19445fb012d6572774eb9f67

Instead of this happening, it exits on all but no.1. Could there be an issue with servers running under different users?

<!-- gh-comment-id:234801861 --> @Luc1f3rUK commented on GitHub (Jul 24, 2016): I run 8 gameservers on one Linux box, but under different users. (tf2server thru 8) tf2server (1) does this correctly: https://gyazo.com/06c7975c19445fb012d6572774eb9f67 Instead of this happening, it exits on all but no.1. Could there be an issue with servers running under different users?
Author
Owner

@dgibbs64 commented on GitHub (Jul 24, 2016):

The quit command depends upon the server. Some servers quit means shutdown and others its means restart. Should quit mean shutdown the tmux session normally closes as it kills the process. However if quit means restart the process is kept alive and the tmux session is not closed.

Quit meaning restart is a bit of a pain imo as when the server is stopped LGSM sends the quit command to to a graceful shutdown. However the server instead just starts itself back up (Insurgency is an example) meaning stop will take over 30 seconds.

Servers running under different users are separate and should have no bearing on each other.

The issue does not sound like a problem with LGSM to me but rather the server or plugins you are using.

If you have setup LGSM to monitor the server even if the server was killed it will be back online within a few mins.

I hope this explanation helps you a little

<!-- gh-comment-id:234808189 --> @dgibbs64 commented on GitHub (Jul 24, 2016): The quit command depends upon the server. Some servers quit means shutdown and others its means restart. Should quit mean shutdown the tmux session normally closes as it kills the process. However if quit means restart the process is kept alive and the tmux session is not closed. Quit meaning restart is a bit of a pain imo as when the server is stopped LGSM sends the quit command to to a graceful shutdown. However the server instead just starts itself back up (Insurgency is an example) meaning stop will take over 30 seconds. Servers running under different users are separate and should have no bearing on each other. The issue does not sound like a problem with LGSM to me but rather the server or plugins you are using. If you have setup LGSM to monitor the server even if the server was killed it will be back online within a few mins. I hope this explanation helps you a little
Author
Owner

@UltimateByte commented on GitHub (Jul 25, 2016):

Yeah, from your last screenshot, the server IS catching the quit command, but the game server just happens to restart instead for some reason. Garry's Mod did the same at one point, it wasn't a plugin issue, it was gmod itself, so we had to complain about it on their github in order for them to correct it. But some addons might cause that too.

If you wanna restart and you're in a hurry, you can also force close the server before using the restart command. For that, you can kill the pid, but finding it is kinda boring, so I usually run ./gameserver console, then press ctrl + c. to terminate the process Then ./gameserver restart.

<!-- gh-comment-id:234885467 --> @UltimateByte commented on GitHub (Jul 25, 2016): Yeah, from your last screenshot, the server IS catching the quit command, but the game server just happens to restart instead for some reason. Garry's Mod did the same at one point, it wasn't a plugin issue, it was gmod itself, so we had to complain about it on their github in order for them to correct it. But some addons might cause that too. If you wanna restart and you're in a hurry, you can also force close the server before using the restart command. For that, you can kill the pid, but finding it is kinda boring, so I usually run ./gameserver console, then press ctrl + c. to terminate the process Then ./gameserver restart.
Author
Owner

@Luc1f3rUK commented on GitHub (Jul 25, 2016):

That's unusual. The TF2 servers running on that box are all direct clones of eachother.

I also have 2 other seperate dedicated servers with 8 servers on, and the first server (tf2server) on those boxes acts the same way as the above screenshot and the others exit.

This is becoming more strange every time I think about it.

<!-- gh-comment-id:234886829 --> @Luc1f3rUK commented on GitHub (Jul 25, 2016): That's unusual. The TF2 servers running on that box are all direct clones of eachother. I also have 2 other seperate dedicated servers with 8 servers on, and the first server (tf2server) on those boxes acts the same way as the above screenshot and the others exit. This is becoming more strange every time I think about it.
Author
Owner

@Luc1f3rUK commented on GitHub (Jul 25, 2016):

We've deployed the monitor system through a cron job for every 5 mins. (Not sure why I didn't do this a while back)

All my servers go down for updates automatically (plugin detects a Steam update and restarts the server)
I guess the monitor will bring them back up if they don't on their own.

Still doesn't explain the issue.

<!-- gh-comment-id:234911483 --> @Luc1f3rUK commented on GitHub (Jul 25, 2016): We've deployed the monitor system through a cron job for every 5 mins. (Not sure why I didn't do this a while back) All my servers go down for updates automatically (plugin detects a Steam update and restarts the server) I guess the monitor will bring them back up if they don't on their own. Still doesn't explain the issue.
Author
Owner

@UltimateByte commented on GitHub (Jul 25, 2016):

"All my servers go down for updates automatically (plugin detects a Steam update and restarts the server)"

What if this update plugin fucks things up ? Why are you even using a plugin for that if you can run LGSM's update checker as a cronjob ? :p
https://github.com/dgibbs64/linuxgsm/wiki/Update

Edit :
(sorry for closing, misclick)

<!-- gh-comment-id:234911867 --> @UltimateByte commented on GitHub (Jul 25, 2016): "All my servers go down for updates automatically (plugin detects a Steam update and restarts the server)" What if this update plugin fucks things up ? Why are you even using a plugin for that if you can run LGSM's update checker as a cronjob ? :p https://github.com/dgibbs64/linuxgsm/wiki/Update Edit : (sorry for closing, misclick)
Author
Owner

@UltimateByte commented on GitHub (Aug 27, 2016):

Well, closing as isolated issue and no feedback.

<!-- gh-comment-id:242928596 --> @UltimateByte commented on GitHub (Aug 27, 2016): Well, closing as isolated issue and no feedback.
Author
Owner

@lock[bot] commented on GitHub (Jul 19, 2018):

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

<!-- gh-comment-id:406173965 --> @lock[bot] commented on GitHub (Jul 19, 2018): This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
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#756
No description provided.