Browse Source

fix: exit handler

pull/5/head
Daniel Gibbs 3 years ago
parent
commit
e36f242d31
  1. 3
      Dockerfile.ubuntu-1804
  2. 3
      Dockerfile.ubuntu-2004
  3. 3
      Dockerfile.ubuntu-2204
  4. 8
      entrypoint.sh

3
Dockerfile.ubuntu-1804

@ -105,3 +105,6 @@ HEALTHCHECK --interval=1m --timeout=1m --start-period=2m --retries=1 CMD /linuxg
RUN rm -f /linuxgsm/entrypoint.sh RUN rm -f /linuxgsm/entrypoint.sh
COPY entrypoint.sh /linuxgsm/entrypoint.sh COPY entrypoint.sh /linuxgsm/entrypoint.sh
RUN date > /time.txt RUN date > /time.txt
ENTRYPOINT [ "/usr/bin/tini","-g","--" ]
CMD [ "bash","./entrypoint.sh" ]

3
Dockerfile.ubuntu-2004

@ -104,3 +104,6 @@ HEALTHCHECK --interval=1m --timeout=1m --start-period=2m --retries=1 CMD /linuxg
RUN rm -f /linuxgsm/entrypoint.sh RUN rm -f /linuxgsm/entrypoint.sh
COPY entrypoint.sh /linuxgsm/entrypoint.sh COPY entrypoint.sh /linuxgsm/entrypoint.sh
RUN date > /time.txt RUN date > /time.txt
ENTRYPOINT [ "/usr/bin/tini","-g","--" ]
CMD [ "bash","./entrypoint.sh" ]

3
Dockerfile.ubuntu-2204

@ -104,3 +104,6 @@ HEALTHCHECK --interval=1m --timeout=1m --start-period=2m --retries=1 CMD /linuxg
RUN rm -f /linuxgsm/entrypoint.sh RUN rm -f /linuxgsm/entrypoint.sh
COPY entrypoint.sh /linuxgsm/entrypoint.sh COPY entrypoint.sh /linuxgsm/entrypoint.sh
RUN date > /time.txt RUN date > /time.txt
ENTRYPOINT [ "/usr/bin/tini","-g","--" ]
CMD [ "bash","./entrypoint.sh" ]

8
entrypoint.sh

@ -2,13 +2,15 @@
exit_handler() { exit_handler() {
# Execute the shutdown commands # Execute the shutdown commands
echo "recieved SIGTERM stopping ${GAMESERVER}" echo "stopping ${GAMESERVER}"
./${GAMESERVER} stop ./${GAMESERVER} stop
exitcode=$?
exit ${exitcode}
} }
# Exit trap # Exit trap
echo "loading exit trap" echo "Loading exit handler"
trap exit_handler SIGTERM trap exit_handler SIGQUIT SIGINT SIGTERM
echo -e "" echo -e ""
echo -e "Welcome to the LinuxGSM" echo -e "Welcome to the LinuxGSM"

Loading…
Cancel
Save