GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.32k stars 821 forks source link

script not creating lock file - TF2 server #134

Closed twinsuns closed 10 years ago

twinsuns commented 10 years ago

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.

DreamDemon commented 10 years ago

Which flavor of linux are you using?

twinsuns commented 10 years ago

CentOS 6.5

DreamDemon commented 10 years ago

Are you running the start command from cron?

twinsuns commented 10 years ago

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.

DreamDemon commented 10 years ago

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.

twinsuns commented 10 years ago

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.

dgibbs64 commented 10 years ago

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

dgibbs64 commented 10 years ago

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.

twinsuns commented 10 years ago

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.

markgs commented 10 years ago

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.

dgibbs64 commented 10 years ago

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

lock[bot] commented 6 years ago

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.