mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-25 06:05:57 +03:00
[GH-ISSUE #172] [gmodserver] : No lock file found: Monitor disabled #137
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#137
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 @UltimateByte on GitHub (Sep 17, 2014).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/172
Originally assigned to: @dgibbs64 on GitHub.
Hi,
I had an old version of the script, and updated it recently. Thanks for the console being smooth now (first thing i noticed).
The automatic monitor didn't work at all with the previous version, but the manual one worked all the time.
Now, after a server crash : the automatic monitor still doesn't work, and the manual one says that :
gmodserver@mesnie:~$ ./gmodserver monitor
[ INFO ] Monitoring gmod-server: No lock file found: Monitor disabled
To enable monitor run ./gmodserver start
So what ? Does the script auto-closes now ?
I'm a bit lost here, any help would be very appreciated.
EDIT/TEMPORARY FIX : Issue caused by the update-restart function that breaks the lock file that is used to tell the monitor function that the server is started and that it can process to monitoring (so if you stop the server, monitor doesn't automatically relaunches it). Temporary fix : change automatic update-restart by a simple restart. If you need to update-restart, think about making a simple restart after that.
Issue replicating :

@dgibbs64 commented on GitHub (Sep 17, 2014):
Basically start the server and the monitor will then be activated.
./gmodserver start
this will activate the server monitor by creating a lock file. If the lock file is not present the monitor will not activate.
I will be adding these details to the faq as it is confusing people.
The lock file was introduced to stop the server monitor re-activating the server even if the administrator deliberately stopped the server.
@UltimateByte commented on GitHub (Sep 17, 2014):
Thanks for your fast answer. The fact is... I never stopped the server, i'm on a dedicated one, i wish it's always ON.
When i just started the server :
gmodserver@mesnie:~$ ./gmodserver monitor
[ OK ] Monitoring gmod-server: Checking session: OK
[ OK ] Monitoring gmod-server: Querying port: 212.83.180.24:27024: OK
After a while when the server crashed :
gmodserver@mesnie:~$ ./gmodserver monitor
[ INFO ] Monitoring gmod-server: No lock file found: Monitor disabled
To enable monitor run ./gmodserver start
@dgibbs64 commented on GitHub (Sep 17, 2014):
As long as a lock file exists the monitor will work :). So you could never stop the server and the monitor will continue to work. Is the issue resolved or is there still an issue?
@UltimateByte commented on GitHub (Sep 17, 2014):
I'm not sure to understand you : why would the lock fike disappear as it does ? My issue is there.
@UltimateByte commented on GitHub (Sep 17, 2014):
I've seen your answers there https://github.com/dgibbs64/linuxgameservers/issues/171#issuecomment-55881559
Could you please telle me where is the lock file located, so i check the permissions on it ? (with ls -l )
The weird thing is : Right after the server started, the monitor function is OK. But a after some time (my guess is after a crash), the manual monitor function doesn't work anymore.
The result is the server still doesn't auto restart thanks to server query after a crash/freeze of the server that is not detected by SRCDS and so doesn't auto restart.
Could it be the crontab monitor function that fails ?
For information, my user crontab :
0 5 * * * /home/gmodserver/gmodserver update-restart > /dev/null 2>&1
*/5 * * * * /home/gmodserver/gmodserver monitor > /dev/null 2>&1
(I have no crontab for root)
I also take advantage of this thread to ask you a question that i got for a long time : Do we need
My guess is the answer is 2)
For your information, I'm using Debian
Thanks in advance
@dgibbs64 commented on GitHub (Sep 17, 2014):
The lock file is located in the servers main directory its hidden but ls -al will reveal it
e.g /home/gmodserver/.gmod-server.lock
double check the permissions for the lock file when its running.
I cannot see any obvious reason why you are having an issue. the cron for update-restart runs the stop, update and start functions. Stop will remove the lock and start will re create it.
To answer your question
how you set your cronjobs are up to you. You can run the cron either with the root crontab OR the user crontab. I prefer to put them in the root crontab just so I can quickly see all my cronjobs for the server.
If you notice the root cronjob will run the command as the user and not root. The server will not run a root
@UltimateByte commented on GitHub (Sep 18, 2014):
OK, i guess this picture will illustrate my issue : http://image.noelshack.com/fichiers/2014/38/1411039545-gmod-bug.jpg
Server is ON for a while, don't know what happens in between, then lockfile disappears even if the server's still ON..
After a ./gmodserver restart, the lockfile appears again, and it has the following rules :
-rw-r--r-- 1 gmodserver gmodserver 30 Sep 18 13:16 .gmod-server.lock
@dgibbs64 commented on GitHub (Sep 18, 2014):
How odd. there is no code to remove the lockfile apart from ./gmodserver stop. Something is removing the file but what I dont know. Next time you replicate it post the script logfile under log/script. That might help identify if the script is doing anything it shouldnt.
@UltimateByte commented on GitHub (Sep 18, 2014):
Thanks for your reply, i found where the problem is !!! This seems to be a script related issue.
The update-restart fonction breaks the lock file !
How to replicate : http://image.noelshack.com/fichiers/2014/38/1411050818-update-restart-fail2.jpg
And also, i was wrong : when the lock file is there, the automatic monitor function actually works well according to the logs.
Temporary fix : Change automatic update-restart with a simple restart, and manually update-restart if needed.
This is what i was writing when i found out what was making the issue occur, it's now quite obsolete, or maybe my logs could help you Daniel, solving this issue :
I just downloaded the last logs as the issue just occured. Seems like the log is written only after a server stop or restart isn't it ?
So i checked the log before the problem occured : The server monitor query is actually working every 5 minutes as we want.
But it seems like the issue begins after the daily server reboot at 5.
Here is the end of the log just before the auto reboot at 5 : gmod-server-script-18-09-2014-05-00-01.log
Sep 18 04:45:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 04:45:03 gmod-server: 'Checking session: CHECKING'
Sep 18 04:45:04 gmod-server: 'Checking session: OK'
Sep 18 04:45:05 gmod-server: 'Detected gsquery.py'
Sep 18 04:45:06 gmod-server: 'Querying port: 212.83.180.24:27024: QUERYING'
Sep 18 04:45:07 gmod-server: 'Querying port: 212.83.180.24:27024: OK'
Sep 18 04:50:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 04:50:03 gmod-server: 'Checking session: CHECKING'
Sep 18 04:50:04 gmod-server: 'Checking session: OK'
Sep 18 04:50:05 gmod-server: 'Detected gsquery.py'
Sep 18 04:50:06 gmod-server: 'Querying port: 212.83.180.24:27024: QUERYING'
Sep 18 04:50:07 gmod-server: 'Querying port: 212.83.180.24:27024: OK'
Sep 18 04:55:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 04:55:03 gmod-server: 'Checking session: CHECKING'
Sep 18 04:55:04 gmod-server: 'Checking session: OK'
Sep 18 04:55:05 gmod-server: 'Detected gsquery.py'
Sep 18 04:55:06 gmod-server: 'Querying port: 212.83.180.24:27024: QUERYING'
Sep 18 04:55:08 gmod-server: 'Querying port: 212.83.180.24:27024: OK'
Sep 18 05:00:02 gmod-server: 'Stopping [FR] La Mesnie - Build et Fun'
Sep 18 05:00:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 05:00:02 gmod-server: 'Stopped [FR] La Mesnie - Build et Fun'
Sep 18 05:00:03 gmod-server: 'Detected SteamCMD is checking for updates'
Sep 18 05:00:04 gmod-server: 'When updates complete gmod-server will start'
Sep 18 05:00:05 gmod-server: 'Updating [FR] La Mesnie - Build et Fun'
Redirecting stderr to '/home/gmodserver/Steam/logs/stderr.txt'
[ 0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.
Connecting anonymously to Steam Public...Logged in OK
Waiting for license info...OK
Success! App '4020' already up to date.
Now here is the entire next and last log, that started the after the auto reboot. I just restarted the server after that so i can get back the monitor function, just before in the previous comment : gmod-server-script-18-09-2014-13-16-40.log
Sep 18 05:00:11 gmod-server: 'Starting [FR] La Mesnie - Build et Fun'
Sep 18 05:00:12 gmod-server: 'Started [FR] La Mesnie - Build et Fun'
Sep 18 13:16:40 gmod-server: 'Restarting [FR] La Mesnie - Build et Fun'
Sep 18 13:16:41 gmod-server: 'Stopping [FR] La Mesnie - Build et Fun'
Sep 18 13:16:41 gmod-server: 'Stopped [FR] La Mesnie - Build et Fun'
Sep 18 13:16:44 gmod-server: 'Starting log cleaner'
Sep 18 13:16:46 gmod-server: 'Removing logs older than 7 days'
/home/gmodserver/log/script/gmod-server-script-10-09-2014-05-00-01.log
/home/gmodserver/log/console/gmod-server-console-10-09-2014-05-00-01.log
Sep 18 13:16:48 gmod-server: 'Log cleaner removed 2 log files'
As we can see, the monitor function doesn't occurs anymore.
Now i'll try restarting the server as i'm writing this to see the last log (that is definately written on server shutdown) :
New log appears : gmod-server-script-18-09-2014-15-59-05.log
Sep 18 13:16:49 gmod-server: 'Starting [FR] La Mesnie - Build et Fun'
Sep 18 13:16:50 gmod-server: 'Started [FR] La Mesnie - Build et Fun'
Sep 18 13:20:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 13:20:03 gmod-server: 'Checking session: CHECKING'
Sep 18 13:20:04 gmod-server: 'Checking session: OK'
Sep 18 13:20:05 gmod-server: 'Detected gsquery.py'
Sep 18 13:20:06 gmod-server: 'Querying port: 212.83.180.24:27024: QUERYING'
Sep 18 13:20:07 gmod-server: 'Querying port: 212.83.180.24:27024: OK'
Sep 18 13:25:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 13:25:03 gmod-server: 'Checking session: CHECKING'
Sep 18 13:25:04 gmod-server: 'Checking session: OK'
Sep 18 13:25:05 gmod-server: 'Detected gsquery.py'
<.............>
Sep 18 15:55:02 gmod-server: 'Monitoring [FR] La Mesnie - Build et Fun'
Sep 18 15:55:03 gmod-server: 'Checking session: CHECKING'
Sep 18 15:55:04 gmod-server: 'Checking session: OK'
Sep 18 15:55:05 gmod-server: 'Detected gsquery.py'
Sep 18 15:55:06 gmod-server: 'Querying port: 212.83.180.24:27024: QUERYING'
Sep 18 15:55:07 gmod-server: 'Querying port: 212.83.180.24:27024: OK'
Sep 18 15:56:35 gmod-server: 'Console accessed'
Sep 18 15:57:47 gmod-server: 'Console accessed'
Sep 18 15:59:05 gmod-server: 'Restarting [FR] La Mesnie - Build et Fun'
Sep 18 15:59:06 gmod-server: 'Stopping [FR] La Mesnie - Build et Fun'
Sep 18 15:59:06 gmod-server: 'Stopped [FR] La Mesnie - Build et Fun'
So the monitor and automatic monitor works great after a manual reboot, but not after the automatic update-restart.
Let's try to make a manual update-restart, and see if it breaks the monitor function : It does !
Here is the issue !
@UltimateByte commented on GitHub (Sep 18, 2014):
@dgibbs64 update-restart bug,makes sense to you ?
@dgibbs64 commented on GitHub (Sep 18, 2014):
Thanks buddy I will check this out.
@uGamers commented on GitHub (Sep 18, 2014):
I think thats the problem with mine aswell
@dgibbs64 commented on GitHub (Sep 20, 2014):
Found the bug and a fix. The fix will roll out with the next update.
@UltimateByte commented on GitHub (Sep 20, 2014):
You're definately the best ! Thanks Daniel !
@dgibbs64 commented on GitHub (Sep 20, 2014):
No worries buddy :)
@lock[bot] commented on GitHub (Jul 20, 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.