From 7b44c28077f531631e03f9afa58f4b3c18cb3bb3 Mon Sep 17 00:00:00 2001 From: Red-Thirten Date: Sat, 26 Nov 2022 22:28:27 -0800 Subject: [PATCH 1/2] Add `numactl` to Dockerfile Adds `numactl` package so it can be used within entrypoint.sh. --- games/arma3/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/games/arma3/Dockerfile b/games/arma3/Dockerfile index 82ba373..f5231ff 100644 --- a/games/arma3/Dockerfile +++ b/games/arma3/Dockerfile @@ -17,6 +17,7 @@ RUN dpkg --add-architecture i386 \ iproute2 \ gettext-base \ ca-certificates \ + numactl \ libssl-dev \ lib32gcc-s1 \ libsdl2-2.0-0 \ From 38ec9eb9dc850c2edc3db9925a28cf5109e04528 Mon Sep 17 00:00:00 2001 From: Red-Thirten Date: Sat, 26 Nov 2022 22:38:19 -0800 Subject: [PATCH 2/2] Change entrypoint.sh to run SteamCMD on one CPU - Utilize `numactl` to force SteamCMD to run on only one CPU which resolves its current crashing issues on Debian. - SteamCMD now complains about thread priority due to it failing to properly load `libSDL` (`libSDL` is included in the image, but will not load properly if it is not installed on the host due to it containing a kernel extension). Therefore, any warnings regarding threads will now be ignored. - If SteamCMD fatally crashes, copy the directory where it saves its dumps (`/tmp/dumps`) to `/home/container` for easier debugging access. --- games/arma3/entrypoint.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/games/arma3/entrypoint.sh b/games/arma3/entrypoint.sh index b9925d4..289935a 100644 --- a/games/arma3/entrypoint.sh +++ b/games/arma3/entrypoint.sh @@ -3,7 +3,7 @@ ## File: Pterodactyl Arma 3 Image - entrypoint.sh ## Author: David Wolfe (Red-Thirten) ## Contributors: Aussie Server Hosts (https://aussieserverhosts.com/), Stephen White (SilK) -## Date: 2022/05/22 +## Date: 2022/11/26 ## License: MIT License ## === CONSTANTS === @@ -46,14 +46,14 @@ function RunSteamCMD { #[Input: int server=0 mod=1 optional_mod=2; int id] # Check if updating server or mod if [[ $1 == 0 ]]; then # Server - ${STEAMCMD_DIR}/steamcmd.sh +force_install_dir /home/container "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +app_update $2 $extraFlags $validateServer +quit | tee -a "${STEAMCMD_LOG}" + numactl --physcpubind=+0 ${STEAMCMD_DIR}/steamcmd.sh +force_install_dir /home/container "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +app_update $2 $extraFlags $validateServer +quit | tee -a "${STEAMCMD_LOG}" else # Mod - ${STEAMCMD_DIR}/steamcmd.sh "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +workshop_download_item $GAME_ID $2 +quit | tee -a "${STEAMCMD_LOG}" + numactl --physcpubind=+0 ${STEAMCMD_DIR}/steamcmd.sh "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +workshop_download_item $GAME_ID $2 +quit | tee -a "${STEAMCMD_LOG}" fi # Error checking for SteamCMD steamcmdExitCode=${PIPESTATUS[0]} - if [[ -n $(grep -i "error\|failed" "${STEAMCMD_LOG}" | grep -iv "setlocal\|SDL") ]]; then # Catch errors (ignore setlocale and SDL warnings) + if [[ -n $(grep -i "error\|failed" "${STEAMCMD_LOG}" | grep -iv "setlocal\|SDL\|thread") ]]; then # Catch errors (ignore setlocale, SDL, and thread priority warnings) # Soft errors if [[ -n $(grep -i "Timeout downloading item" "${STEAMCMD_LOG}") ]]; then # Mod download timeout echo -e "\n${YELLOW}[UPDATE]: ${NC}Timeout downloading Steam Workshop mod: \"${CYAN}${modName}${NC}\" (${CYAN}${2}${NC})" @@ -96,6 +96,7 @@ function RunSteamCMD { #[Input: int server=0 mod=1 optional_mod=2; int id] elif [[ $steamcmdExitCode != 0 ]]; then # Unknown fatal error echo -e "\n${RED}[UPDATE]: SteamCMD has crashed for an unknown reason!${NC} (Exit code: ${CYAN}${steamcmdExitCode}${NC})" echo -e "\t${YELLOW}(Please contact your administrator/host for support)${NC}\n" + cp -r /tmp/dumps /home/container/dumps exit $steamcmdExitCode else # Success! if [[ $1 == 0 ]]; then # Server @@ -220,7 +221,7 @@ allMods=$(echo $allMods | sed -e 's/;/ /g') # Convert from string to array # Update everything (server and mods), if specified if [[ ${UPDATE_SERVER} == 1 ]]; then echo -e "\n${GREEN}[STARTUP]: ${CYAN}Starting checks for all updates...${NC}" - echo -e "(It is okay to ignore any \"SDL\" errors during this process)\n" + echo -e "(It is okay to ignore any \"SDL\" and \"thread priority\" errors during this process)\n" ## Update game server echo -e "${GREEN}[UPDATE]:${NC} Checking for game server updates with App ID: ${CYAN}${STEAMCMD_APPID}${NC}..."