GameServerManagers / LinuxGSM

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

Server should be stopped during mods-update #2068

Open borzaka opened 5 years ago

borzaka commented 5 years ago

From the SourceMod Wiki: Upgrading SourceMod

Ensure your game server is completely stopped and not running as you cannot update some files while they are still in use.

Running: ./csgoserver mods-update

csgoserver@dellserver:~$ ./csgoserver mods-update
[ INFO ] Mods Update csgoserver: Update addons/mods: 2 addons/mods will be updated
        * MetaMod (retain common custom files)
        * SourceMod (retain common custom files)

==> Updating MetaMod
creating mod download directory /home/csgoserver/lgsm/mods/tmp...OK
######################################################################## 100.0%it966-linux.tar.gz...
OK
extracting mmsource-1.10.7-git966-linux.tar.gz...OK
the following files/directories will be preserved:
        * serverfiles/addons/metamod/metaplugins.ini
building metamod-files.txt...OK
copying MetaMod to /home/csgoserver/serverfiles/csgo...OK
tidy up metamod-files.txt...OK
clearing mod download directory /home/csgoserver/lgsm/mods/tmp...OK

==> Updating SourceMod
creating mod download directory /home/csgoserver/lgsm/mods/tmp...OK
######################################################################## 100.0%git6260-linux.tar.gz...
OK
extracting sourcemod-1.9.0-git6260-linux.tar.gz...OK
the following files/directories will be preserved:
        * serverfiles/cfg
        * serverfiles/addons/sourcemod/configs
building sourcemod-files.txt...OK
copying SourceMod to /home/csgoserver/serverfiles/csgo...OK
tidy up sourcemod-files.txt...OK
clearing mod download directory /home/csgoserver/lgsm/mods/tmp...OK

[  OK  ] Mods Update csgoserver: Mods update complete

Expected behaviour A server should be stopped during mods-update, and restart after it's finished.

Additional context mods-update is updating the mods regardless the version installed. It's updating even an updated version as well.

dgibbs64 commented 5 years ago

From what I remember there was no way to track the versions of the mods to only update when required. But that might of changed since. This issue will need to be investigated

0xlord commented 5 years ago

FLAX, an ARMA mod/server tool checks the changelog and/or the last update time to determine if a mod has been updated. This would require a way to keep track when a mod was last updated. This could be done by a simple text/config file in which is written what Workshop id was updated for the last time:

id.time = actual workshop version --> do nothing id.time = not available --> download and install (as new mod being added) id.time = older than last workshop version --> download and update

borzaka commented 5 years ago

The issue is about that any source based game server should be stopped during mods update/install/remove and restarted after the update/install/remove is finished (if it was stopped before).

BTW, you can check the latest version filename:

Maybe storing these filenames, and compare it could help not running an update on an already up to date mod.

dgibbs64 commented 5 years ago

Will update to stop the server when a mods update is started