1zc / CS2-Pterodactyl

Docker image and Pterodactyl eggs to support CS2 and CS:GO (after archival), based on SteamRT3.
GNU General Public License v3.0
87 stars 26 forks source link

server.cfg is being overwritten upon startup file validation #49

Open Jay2k1 opened 3 months ago

Jay2k1 commented 3 months ago

This is probably not an issue with this egg, but honestly, I do not know where else to look or ask.

My problem

I have set some things like server name and password in game/csgo/cfg/server.cfg. This works fine until an update is released and I restart the server (container). Upon restart, it downloads the update. My other CS2 servers then run a verify when they're restarted (details below), and this verify causes the server.cfg to be replaced by the original server.cfg. This is even logged in Steam/logs/content_log.txt:

[2024-08-09 03:00:43] Validation: 0 chunks corrupt and 1 chunks missing of 1 total in file "game\core\pak01_dir.vpk"
[2024-08-09 03:00:44] Validation: truncated unwanted 70 bytes from file "game\csgo\cfg\server.cfg"

Edit: This also happens when you trigger a manual validation by setting "Validate Install" (SRCDS_VALIDATE) to 1 in the panel:

[2024-08-09 17:00:46] AppID 730 update changed : Running Update,Validating,
[2024-08-09 17:00:57] Validation: truncated unwanted 71 bytes from file "game\csgo\cfg\server.cfg"

After validation, the file is back to its default contents:

// Defaults in server_default.cfg

Questions I have

Details why (I think) the validation happens

I run several CS2 servers. By default, each install would occupy about 42 GB, so I created a mount in Pterodactyl that I use for all CS2 eggs (/cs2-base) and moved big files/folders that are identical in all servers there and then symlinked them. It's mostly the vpk files and the panorama and maps folders. The game/csgo folder looks like this:

image

This moving-and-replacing-by-symlink is automated by a script that runs 30 minutes after the first cs2 server (let's call it the master server) has its daily restart. The script would check for any non-symlinked vpk files and if it finds any, it moves them to the base folder and symlinks them.

An hour later, the other cs2 servers get their daily restart. When an update was released, they for some reason realize that there was a change - even though they already have the updated vpk files (due to the symlinks) - and run a verify. This finds issues with the updated vpk files (it shouldn't, again, the new files are already there due to the symlinks, but maybe checksums aren't computed live but stored somewhere, who knows) and the vpk files are redownloaded, requiring another run of my "relink-files" script afterwards. Either way, this validation is what causes the server.cfg to be messed with. The validation does not occur on the first server (the master server) when it restarts and there is an update available, which might explain why other people don't seem to have this issue. I'm probably the only one who runs it like this...

ItsCEED commented 2 months ago

@Jay2k1 can ya hook me with that script? 👀

Jay2k1 commented 2 months ago

sure: https://gist.github.com/Jay2k1/17d4a50779a8250ff78b5ac1254e08e0

M-archand commented 1 month ago

is there a better place for me to put custom global server settings?

Yes, put them in gamemode_<yourgamemode>_server.cfg, so if custom for eg, then put them in gamemode_custom_server.cfg

@Jay2k1