[GH-ISSUE #134] script not creating lock file - TF2 server #108

Closed
opened 2026-02-27 01:59:32 +03:00 by kerem · 12 comments
Owner

Originally created by @twinsuns on GitHub (Aug 8, 2014).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/134

When I start a TF2 server a lock file is not being created, so when I try running ./tf2server monitor I get No lock file found: Monitor disabled.

If I manually create it using date > .tf2-server.lock I can run monitoring fine and the lock file gets removed on server stop. But for some reason lock files simply are not being created on server start.

Also I haven't modified the core script in any way.

Originally created by @twinsuns on GitHub (Aug 8, 2014). Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/134 When I start a TF2 server a lock file is not being created, so when I try running `./tf2server monitor ` I get `No lock file found: Monitor disabled`. If I manually create it using `date > .tf2-server.lock` I can run monitoring fine and the lock file gets removed on server stop. But for some reason lock files simply are not being created on server start. Also I haven't modified the core script in any way.
kerem 2026-02-27 01:59:32 +03:00
  • closed this issue
  • added the
    type: bug
    label
Author
Owner

@DreamDemon commented on GitHub (Aug 8, 2014):

Which flavor of linux are you using?

<!-- gh-comment-id:51595861 --> @DreamDemon commented on GitHub (Aug 8, 2014): Which flavor of linux are you using?
Author
Owner

@twinsuns commented on GitHub (Aug 8, 2014):

CentOS 6.5

<!-- gh-comment-id:51596031 --> @twinsuns commented on GitHub (Aug 8, 2014): CentOS 6.5
Author
Owner

@DreamDemon commented on GitHub (Aug 8, 2014):

Are you running the start command from cron?

<!-- gh-comment-id:51607234 --> @DreamDemon commented on GitHub (Aug 8, 2014): Are you running the start command from cron?
Author
Owner

@twinsuns commented on GitHub (Aug 8, 2014):

Nope, I start the server on boot in rc.local using ./tf2server update-restart to check that the game is up to date. On further investigation I notice that when running start or restart then the lock file gets created fine. It just seems to be when using update-restart that the issue occurs.

<!-- gh-comment-id:51609454 --> @twinsuns commented on GitHub (Aug 8, 2014): Nope, I start the server on boot in rc.local using `./tf2server update-restart` to check that the game is up to date. On further investigation I notice that when running `start` or `restart` then the lock file gets created fine. It just seems to be when using `update-restart` that the issue occurs.
Author
Owner

@DreamDemon commented on GitHub (Aug 8, 2014):

Merely as a suggestion, mine is set to use just the start command in there. I have a cron job that runs at 5am that does the update-restart command. Additionally, mine uses the full path (eg. /opt/cssserver update-restart) which works without a hitch.

<!-- gh-comment-id:51652098 --> @DreamDemon commented on GitHub (Aug 8, 2014): Merely as a suggestion, mine is set to use just the start command in there. I have a cron job that runs at 5am that does the update-restart command. Additionally, mine uses the full path (eg. /opt/cssserver update-restart) which works without a hitch.
Author
Owner

@twinsuns commented on GitHub (Aug 9, 2014):

Thanks for the suggestion, however it doesn't solve the problem as however I run update-restart (even from a cron job and using the full path), it will still remove the existing lock file and fail to create a new one.

So the problem still stands and somehow revolves around update-restart only, weird.

For a temporary workaround I will run the update then start commands separately and see how that goes.

<!-- gh-comment-id:51683338 --> @twinsuns commented on GitHub (Aug 9, 2014): Thanks for the suggestion, however it doesn't solve the problem as however I run `update-restart` (even from a cron job and using the full path), it will still remove the existing lock file and fail to create a new one. So the problem still stands and somehow revolves around `update-restart` only, weird. For a temporary workaround I will run the `update` then `start` commands separately and see how that goes.
Author
Owner

@dgibbs64 commented on GitHub (Aug 9, 2014):

The lock file is a new feature. I will check update-restart to figure out why it is not functioning. Stay tuned :-)

<!-- gh-comment-id:51684299 --> @dgibbs64 commented on GitHub (Aug 9, 2014): The lock file is a new feature. I will check update-restart to figure out why it is not functioning. Stay tuned :-)
Author
Owner

@dgibbs64 commented on GitHub (Aug 10, 2014):

Does update-restart work normally when not using it on boot. My guess is it is only not working when using rc.local.

The lock file is created by outputting the date to the lock file. My guess is that on boot the date command maybe does not function correctly on boot.

<!-- gh-comment-id:51721544 --> @dgibbs64 commented on GitHub (Aug 10, 2014): Does update-restart work normally when not using it on boot. My guess is it is only not working when using rc.local. The lock file is created by outputting the date to the lock file. My guess is that on boot the date command maybe does not function correctly on boot.
Author
Owner

@twinsuns commented on GitHub (Aug 10, 2014):

Nope, no matter how I run update-restart (whether it be normally, in a cron job or on boot) it still will not create a lock file. It's really strange sincestart and restart create it fine.

However my workaround of running update and then start separately on boot seems to be working fine so far, therefore it's not the end of the world if you can't think of a solution. :)

Many thanks anyways.

<!-- gh-comment-id:51723261 --> @twinsuns commented on GitHub (Aug 10, 2014): Nope, no matter how I run `update-restart` (whether it be normally, in a cron job or on boot) it still will not create a lock file. It's really strange since`start` and `restart` create it fine. However my workaround of running `update` and then `start` separately on boot seems to be working fine so far, therefore it's not the end of the world if you can't think of a solution. :) Many thanks anyways.
Author
Owner

@markgs commented on GitHub (Aug 24, 2014):

Hi. Sorry I am new here. May I reply to this topic or do I create a new?
I'm using Daniel Gibb's L4D2 GS Script. I've the "No lock file found: Monitor disabled" issue too.
I changed the service name from "l4d2server" to "testserver1" and the monitor function wont work. Creating a new lock file gets deleted when the server stops.

<!-- gh-comment-id:53181541 --> @markgs commented on GitHub (Aug 24, 2014): Hi. Sorry I am new here. May I reply to this topic or do I create a new? I'm using Daniel Gibb's L4D2 GS Script. I've the "No lock file found: Monitor disabled" issue too. I changed the service name from "l4d2server" to "testserver1" and the monitor function wont work. Creating a new lock file gets deleted when the server stops.
Author
Owner

@dgibbs64 commented on GitHub (Aug 26, 2014):

I have just tested this functionality and cannot replicate the issue.

tf2server@vps83003:~$ ./tf2server update-restart
[  OK  ] Stopping tf2-server: test
[  OK  ] Updating tf2-server: testRedirecting stderr to '/home/tf2server/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 '232250' already up to date.
[  OK  ] Starting tf2-server: test

Just to clarify the lock file functionality.

When you run./tf2server start a lock file is created that activates the monitor. Without the lockfile monitor is disabled.

When you run ./tf2server stop the lockfile is removed. This disables the monitor.

You MUST use the start function to start the server.

For example on boot you should be able to use the following to start the server.

./tf2server start
./tf2server restart
./tf2server update-restart
./tf2server validate-restart

However if you use

./tf2server monitor on boot this will not work.

this functionality was added to prevent the monitor starting the server after an admin deliberately stopped the server.

I have looked at the code and I see no reason why there is an issue. The code below shows all update-restart does.

    update-restart)
            fn_stopserver
            fn_updateserver
            fn_startserver;;

This is the equivalent of running
./tf2server stop
./tf2server update
./tf2server start

One after the other

Hope this help

<!-- gh-comment-id:53490600 --> @dgibbs64 commented on GitHub (Aug 26, 2014): I have just tested this functionality and cannot replicate the issue. ``` tf2server@vps83003:~$ ./tf2server update-restart [ OK ] Stopping tf2-server: test [ OK ] Updating tf2-server: testRedirecting stderr to '/home/tf2server/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 '232250' already up to date. [ OK ] Starting tf2-server: test ``` Just to clarify the lock file functionality. When you run./tf2server start a lock file is created that activates the monitor. Without the lockfile monitor is disabled. When you run ./tf2server stop the lockfile is removed. This disables the monitor. You MUST use the start function to start the server. For example on boot you should be able to use the following to start the server. ./tf2server start ./tf2server restart ./tf2server update-restart ./tf2server validate-restart However if you use ./tf2server monitor on boot this will not work. this functionality was added to prevent the monitor starting the server after an admin deliberately stopped the server. I have looked at the code and I see no reason why there is an issue. The code below shows all update-restart does. ``` update-restart) fn_stopserver fn_updateserver fn_startserver;; ``` This is the equivalent of running ./tf2server stop ./tf2server update ./tf2server start One after the other Hope this help
Author
Owner

@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.

<!-- gh-comment-id:406471873 --> @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.
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#108
No description provided.