mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-25 14:15:59 +03:00
[GH-ISSUE #610] Improving the monitor function #487
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference
starred/LinuxGSM#487
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JimTR on GitHub (Jan 6, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/610
The web interface checks on load if the server is running via checking a) there is a tmux session for the server and a query to the server (via php gameq api ) if both are true we are running ... so if tmux = true & gameq = false = dead server, if dead run 'server file monitor' on the server however 'server file monitor' returns


however the server is still crashed
to fix this I have to send the restart command rather than the monitor command ... so how is monitor returning OK when in it has really crashed ?
Note: This is one of the last functions to adjust but currently is totally stock
@dgibbs64 commented on GitHub (Jan 6, 2016):
The monitor query's the server port using gsquery.py https://github.com/dgibbs64/linuxgsm/blob/master/GameServerQuery/gsquery.py
gsquery returns an ok or fail.
@JimTR commented on GitHub (Jan 6, 2016):
It does not appear to work gsquery is returning OK but the server has crashed ... is gsquery probing the server enough ?
@UltimateByte commented on GitHub (Jan 6, 2016):
Sometimes a server answers to query even if the engine isn't responding. It doesn't happen often, but it happens.
@JimTR commented on GitHub (Jan 6, 2016):
I get it every time the web code shows the server crash(image 2 thin blue line at the top) ... however this only happens on Garrys mod and the console reports a segmentation error ... so maybe gsquery needs to probe the server like gameq does (gameq asks the server for loads of info & fails a different way to gsquery)
@UltimateByte commented on GitHub (Jan 6, 2016):
Segmentation fault is supposed to auto reboot the server.
Did you disable autoreboot ?
@UltimateByte commented on GitHub (Jan 6, 2016):
Please, also note this issue with gmod that isn't corrected yet.
https://github.com/Facepunch/garrysmod-issues/issues/2342
@JimTR commented on GitHub (Jan 6, 2016):
no I did not disable it the segmentation fault occurs while the server is running (no interaction i.e no quit command sent) fair enough Gmod issue. The point is when gsquery interacts it thinks the server is running and not failed
@JimTR commented on GitHub (Jan 6, 2016):
unless a player sent the quit command ?
@UltimateByte commented on GitHub (Jan 7, 2016):
The quit command (used by "stop" and ofc "restart" functions of the script) makes a segmentation faut, then if autorestart is enable (by default it's ON) it automatically restarts, without the help of the script, and still within the tmux session. I've been playing around with that crap to understand the gmod bug i just linked. :o)) So if you made a stop command, then the server doesn't shutdown, so it will do a graceful shutdown (kill the process) after 30 seconds.
I think that this may have been corrected already, because now, servers i reboot show graceful restart for 1 or 2 secs, the time to close properly. So your issue is probably here.
That is i guess all there is to know about the quit command doing a segmentation fault.
Is your issue an "all the time" issue, or did it only happen once or a few times ?
If it happened a few times, then i think it's the issue i told you about before : Server still responds to ping, you can even sometimes try to connect to it, BUT CAN'T finalize loading or play properly on it.
As you say "so maybe gsquery needs to probe the server like gameq does (gameq asks the server for loads of info & fails a different way to gsquery)", but i'm not even sure it would be enough for gmod. Keep in mind that this game is a bug itself. At least it feels like that to me, after about 8 years playing to it :o))
BTW, are you talking about this ?
https://github.com/Austinb/GameQ
@JimTR commented on GitHub (Jan 7, 2016):
Yep GameQ .. works well ... but I guess my server fails through players maxing it out which then puts linux instance into 'hunt for memory' which equals segmentation error. The error still is gsquery does not pick this up & returns the server as 'online' gameq on the other hand returns the server offline (which is correct).
@UltimateByte commented on GitHub (Jan 7, 2016):
I don't know python at all, but from the gsquery.py, i guess it sends a query string to the game on the right IP and the right port.
https://github.com/dgibbs64/linuxgsm/blob/master/GameServerQuery/gsquery.py
Do you have any idea how GameQ is working to consider an upgrade to gsquery.py ?
BTW, gsquery has to be reworked so that would be a good combination to either make it a function and improve the querying.
https://github.com/dgibbs64/linuxgsm/issues/567
But as we both had this issue with gmod only, i personally consider this as a low priority issue to fix, more due to the unstability of gmod than to the script.
@JimTR commented on GitHub (Jan 7, 2016):
Ok gameq is dead simple to use via PHP & returns, on/off line, a player list, current map, total players connected and a load more ... so it would not be too difficult to write a php wrapper around the gameq api which could be called from a bash script or perhaps, if python supports it, an exec from python ?
@UltimateByte commented on GitHub (Jan 7, 2016):
This could be an extension to LGSM supported again with the skeleton directory.
https://github.com/dgibbs64/linuxgsm/issues/585
I personally don't have the knowledge to make it.
@UltimateByte commented on GitHub (Jan 9, 2016):
Any idea how to improve it using bash or python rather than an external script ?
Rcon query is a good idea
https://github.com/dgibbs64/linuxgsm/issues/299
@JimTR commented on GitHub (Jan 11, 2016):
I have code running using gameq wraped in some bash code to integrate it into LSGM ... I have fn_gameq which runs what I need ... however I have looked at gsquery.py and it responds with the server up when its actually in un recoverable error ... a good response is like : OK: ����ILightSound Garrys Mod Strandedgms_rollinghills_daynight_b1garrysmodGarry's Mod Stranded�dl15.12.15��i�~|@ gm:gmstranded gmws:133364818� : I am waiting for a server crash to see what the difference is
@UltimateByte commented on GitHub (Jan 12, 2016):
Thanks for the feedback, this will need to be investigated a bit more.
@jaredballou commented on GitHub (Jan 13, 2016):
Well this just ate up a good portion of my night. Hard to let it go, and can't get my tools working the way I'd like. But I'm of the same mind, as neat as gsquery.py is if we could put that functionality into Bash and remove the dependency on Python, I think that might be a good thing. I have a few things that may be useful here.
For rcon, I have a Bash script that worked in the past but now seems b0rked.
https://github.com/jaredballou/insurgency-tools/blob/master/utilities/bin/rcon.sh
As far as PHP, I use the steam-condenser-php library to allow me to query servers.
https://github.com/jaredballou/steam-condenser-php
I have a simple script that then queries servers, and then checks the Steam API to ensure that the servers are up to date.
https://github.com/jaredballou/insurgency-tools/blob/master/server.php
Also for PHP is a much simpler rcon-only class at https://fremnet.net/article/199/source-rcon-class which works.
Rcon binary message format is this:
<packet_id>\0\0
size. packet_id and serverdata are all 32-bit signed longs. size if the binary size of everything from the packet id to the end of the message. command and unused are strings. The null characters in the middle of the string are really making Bash parsing difficult here, so unless someone is better at packing/unpacking binary data, we may have a good reason to switch to Python here. Or, stay with it, as it were.
Also, Valve's RCON protocol wiki: https://developer.valvesoftware.com/wiki/Source_RCON_Protocol
@UltimateByte commented on GitHub (Jan 22, 2016):
@jaredballou I'm not sure to see the point. You wanna remove dependency to python, while adding external bash and php scripts ? I don't think it's working unless we can write a simple bash script that does that. Is that really the only way to improve the monitor function ?
@UltimateByte commented on GitHub (Jan 23, 2016):
Would be very kind to give your final thoughts right here : https://github.com/dgibbs64/linuxgsm/issues/567 and to close this one, as it's kinda duplicate. I'm closing for now, feel free to re-open if your thoughts are a bit complicated to summ up right now.
But please, keep in mind that calling external code for a very important core function such as monitor, is probably not the best idea. I don't wanna speak in the name of dgibbs, but i think it would be better to have our own code, that is simple and fully understandable, so we can maintain and fix it easily if it gets broken at any time.
@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.