From c3b7c53b49799074240200be1cb81249cb883846 Mon Sep 17 00:00:00 2001 From: Luke Policinski Date: Tue, 6 Oct 2026 19:04:38 +0000 Subject: [PATCH] bug: keep practice servers from hibernating A practice server runs UtilityPractice instead of the match plugin, so nothing holds it awake and it fell back to the base server.cfg and the engine's default. Copy that cfg in as a real file with sv_hibernate_when_empty 0 appended. --- apps/counterstrikesharp/scripts/setup.sh | 9 +++++++++ apps/swiftly/scripts/setup.sh | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/apps/counterstrikesharp/scripts/setup.sh b/apps/counterstrikesharp/scripts/setup.sh index 12ecf86c..22581a9d 100755 --- a/apps/counterstrikesharp/scripts/setup.sh +++ b/apps/counterstrikesharp/scripts/setup.sh @@ -58,6 +58,15 @@ if [ "$SERVER_TYPE" = "Ranked" ]; then cp "/opt/server-cfg/5stack.wingman.cfg" "$INSTANCE_SERVER_DIR/game/csgo/cfg" fi +# A practice server runs no match plugin to hold it awake, so the base +# server.cfg it would otherwise be linked to is copied in with hibernation off. +if [ "$SERVER_TYPE" = "Practice" ]; then + if [ -f "$BASE_SERVER_DIR/game/csgo/cfg/server.cfg" ]; then + cp "$BASE_SERVER_DIR/game/csgo/cfg/server.cfg" "$INSTANCE_SERVER_DIR/game/csgo/cfg/server.cfg" + fi + printf '\nsv_hibernate_when_empty 0\n' >> "$INSTANCE_SERVER_DIR/game/csgo/cfg/server.cfg" +fi + if [ ! -d "/opt/custom-plugins/addons/counterstrikesharp/configs" ]; then mkdir -p "/opt/custom-plugins/addons/counterstrikesharp/configs" fi diff --git a/apps/swiftly/scripts/setup.sh b/apps/swiftly/scripts/setup.sh index 2554af19..61a7bc75 100755 --- a/apps/swiftly/scripts/setup.sh +++ b/apps/swiftly/scripts/setup.sh @@ -66,6 +66,15 @@ if [ "$SERVER_TYPE" = "Ranked" ]; then cp "/opt/server-cfg/valve-rulebook.cfg" "$INSTANCE_SERVER_DIR/game/csgo/cfg" fi +# A practice server runs no match plugin to hold it awake, so the base +# server.cfg it would otherwise be linked to is copied in with hibernation off. +if [ "$SERVER_TYPE" = "Practice" ]; then + if [ -f "$BASE_SERVER_DIR/game/csgo/cfg/server.cfg" ]; then + cp "$BASE_SERVER_DIR/game/csgo/cfg/server.cfg" "$INSTANCE_SERVER_DIR/game/csgo/cfg/server.cfg" + fi + printf '\nsv_hibernate_when_empty 0\n' >> "$INSTANCE_SERVER_DIR/game/csgo/cfg/server.cfg" +fi + if [ ! -d "/opt/custom-plugins/addons/swiftlys2/configs" ]; then mkdir -p "/opt/custom-plugins/addons/swiftlys2/configs" fi