From 9d0cb5f7bff28ce687fdc320e24ec31e1c6e8118 Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Fri, 22 Jul 2022 18:12:50 -0700 Subject: [PATCH] Make core file handling be part of docker compose. Remove the shutdown handling hack when the server was crashing on exit. Add a proper stop option now that seinding SIGTERM will properly shut the server down. --- files/dayzserver | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/files/dayzserver b/files/dayzserver index bc8a663..219251a 100755 --- a/files/dayzserver +++ b/files/dayzserver @@ -14,21 +14,17 @@ cyan="\e[36m" function report() { echo echo -e "${yellow}========================================== error.log ==========================================" - find "${HOME}" -name error.log -exec head {} \; -exec rm -f {} \; + find "${HOME}" -name error.log -exec head {} \; -exec tail {} \; -exec rm -f {} \; echo echo -e "${yellow}========================================== script*.log ========================================" - find "${HOME}" -name "script*.log" -exec head {} \; -exec rm -f {} \; + find "${HOME}" -name "script*.log" -exec head {} \; -exec tail {} \; -exec rm -f {} \; echo echo -e "${yellow}========================================== *.RPT ==============================================" - find "${HOME}" -name "*.RPT" -exec ls -la {} \; -exec rm -f {} \; + find "${HOME}" -name "*.RPT" -exec ls -la {} \; -exec tail {} \; -exec rm -f {} \; echo echo -e "${yellow}========================================== End crash log ======================================" } -# Make sure we don't start collecting core files -# FIXME Set this in Docker somewhere -ulimit -c 0 - # DayZ Experimental SteamID, because there is no release version of the Linux server yet appid=1042420 @@ -193,16 +189,13 @@ fn_start_dayz(){ printf "[ ${green}DayZ${default} ] Server starting...\n" ./DayZServer $dayzparameter EXIT_CODE=$? - if [[ ${EXIT_CODE} = "139" ]] - then - EXIT_CODE=0 - fi - printf "[ ${yellow}DayZ${default} ] Server stopped. Exit code: ${EXIT_CODE}\n" + printf "[ ${yellow}DayZ${default} ] Server exited. Exit code: ${EXIT_CODE}\n" exit ${EXIT_CODE} } fn_stop_dayz(){ - echo "Stopping DayZ server...(this is not implemented)" + echo "Stopping DayZ server..." + kill -TERM $(pidof DayZServer) } fn_steam_login(){