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.
This commit is contained in:
Daniel Ceregatti 2022-07-22 18:12:50 -07:00
parent e8d0893569
commit 9d0cb5f7bf

View file

@ -14,21 +14,17 @@ cyan="\e[36m"
function report() { function report() {
echo echo
echo -e "${yellow}========================================== error.log ==========================================" 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
echo -e "${yellow}========================================== script*.log ========================================" 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
echo -e "${yellow}========================================== *.RPT ==============================================" 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
echo -e "${yellow}========================================== End crash log ======================================" 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 # DayZ Experimental SteamID, because there is no release version of the Linux server yet
appid=1042420 appid=1042420
@ -193,16 +189,13 @@ fn_start_dayz(){
printf "[ ${green}DayZ${default} ] Server starting...\n" printf "[ ${green}DayZ${default} ] Server starting...\n"
./DayZServer $dayzparameter ./DayZServer $dayzparameter
EXIT_CODE=$? EXIT_CODE=$?
if [[ ${EXIT_CODE} = "139" ]] printf "[ ${yellow}DayZ${default} ] Server exited. Exit code: ${EXIT_CODE}\n"
then
EXIT_CODE=0
fi
printf "[ ${yellow}DayZ${default} ] Server stopped. Exit code: ${EXIT_CODE}\n"
exit ${EXIT_CODE} exit ${EXIT_CODE}
} }
fn_stop_dayz(){ fn_stop_dayz(){
echo "Stopping DayZ server...(this is not implemented)" echo "Stopping DayZ server..."
kill -TERM $(pidof DayZServer)
} }
fn_steam_login(){ fn_steam_login(){