diff --git a/Dockerfile b/Dockerfile index 8d7e6d8..f4d4eef 100755 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM thmhoag/steamcmd:latest USER root RUN apt-get update && \ - apt-get install -y curl cron bzip2 perl-modules lsof libc6-i386 lib32gcc1 sudo + apt-get install -y curl cron bzip2 perl-modules lsof libc6-i386 lib32gcc1 sudo socat RUN curl -sL "https://raw.githubusercontent.com/FezVrasta/ark-server-tools/v1.6.54/netinstall.sh" | bash -s steam && \ ln -s /usr/local/bin/arkmanager /usr/bin/arkmanager diff --git a/run.sh b/run.sh index 560aead..ff98e6a 100755 --- a/run.sh +++ b/run.sh @@ -10,6 +10,11 @@ echo "########################################################################## echo "# Ark Server - " `date` echo "###########################################################################" +echo "Starting listener on 4000/tcp for health checks" +(socat -4 -lf/dev/null TCP-LISTEN:4000,fork UNIX-CONNECT:/var/run/docker.sock) & +SOCAT_PID=$! +echo "Listener PID ${SOCAT_PID}" + echo "Ensuring correct permissions..." sudo find /ark -not -user steam -o -not -group steam -exec chown -v steam:steam {} \; sudo find /home/steam -not -user steam -o -not -group steam -exec chown -v steam:steam {} \; @@ -121,6 +126,8 @@ fi function stop { + echo "Killing listener on 4000/tcp" + kill -SIGTERM $SOCAT_PID arkmanager broadcast "Server is shutting down" arkmanager notify "Server is shutting down" arkmanager stop