diff --git a/latest/install_script.sh b/latest/install_script.sh index 64d15c4..d08b113 100644 --- a/latest/install_script.sh +++ b/latest/install_script.sh @@ -6,6 +6,7 @@ MARKER_FILE=$VS_SERVER_DIR/.setup_done VS_SERVER_DIR=/vs_server/server VS_DATA_DIR=/vs_server/server/data START_FILE=$VS_SERVER_DIR/server-$VS_VERSION.sh +LOG_FILE=$VS_DATA_DIR/Logs/server-main.log VS_SERVER_FILE=https://cdn.vintagestory.at/gamefiles/$VS_CHANNEL/vs_server_linux-x64_$VS_VERSION.tar.gz MS_REPO_URL=https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb USERNAME=adduser vintagestory @@ -100,7 +101,16 @@ fi # Run vintage-story server. echo " " echo "INFO ! Starting vintage-story Server $VS_VERSION" -echo "Tailing server log to keep container active..." -exec $VS_SERVER_DIR/server-$VS_VERSION.sh start && exec tail -F $VS_DATA_DIR/Logs/server-main.log +exec $VS_SERVER_DIR/server-$VS_VERSION.sh start + +echo "Waiting for the server log file to be created..." +# Loop indefinitely until the log file actually exists on disk +until [ -f "$LOG_FILE" ]; do + sleep 1 +done + +echo "Log file found! Streaming server console now..." +# Hand off PID 1 to tail, keeping the container active permanently +exec tail -f "$LOG_FILE" exit \ No newline at end of file