diff --git a/entrypoint-user.sh b/entrypoint-user.sh index eebaaf8..157e5da 100755 --- a/entrypoint-user.sh +++ b/entrypoint-user.sh @@ -1,16 +1,16 @@ #!/bin/bash -exit_handler() { +exit_handler_user() { # Execute the shutdown commands - echo -e "stopping ${GAMESERVER}" - exec gosu "${USERNAME}" ./"${GAMESERVER}" stop + echo -e "Stopping ${GAMESERVER}" + ./"${GAMESERVER}" stop exitcode=$? exit ${exitcode} } # Exit trap echo -e "Loading exit handler" -trap exit_handler SIGQUIT SIGINT SIGTERM +trap exit_handler_user SIGQUIT SIGINT SIGTERM # Setup game server if [ ! -f "${GAMESERVER}" ]; then @@ -64,4 +64,5 @@ sleep 5 sleep 2 echo -e "Tail log files" echo -e "=================================" -tail -F log/*/*.log +tail -F log/*/*.log & +wait diff --git a/entrypoint.sh b/entrypoint.sh index 3e3091f..967244c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ exit_handler() { # Execute the shutdown commands - echo -e "stopping ${GAMESERVER}" + echo -e "Stopping ${GAMESERVER}" exec gosu "${USERNAME}" ./"${GAMESERVER}" stop exitcode=$? exit ${exitcode} @@ -59,4 +59,5 @@ export HOME=/data echo -e "" echo -e "Switch to user ${USERNAME}" echo -e "=================================" -exec gosu "${USERNAME}" /app/entrypoint-user.sh +exec gosu "${USERNAME}" /app/entrypoint-user.sh & +wait