Skip to content

Commit

Permalink
Switch from su to gosu
Browse files Browse the repository at this point in the history
Using su causes issues with tini, because su creates a new process hierarchy tini cannot properly forward signals to its childs, causing the game server to not shutdown properly in some cases, using gosu fully fixes those issues
  • Loading branch information
Diyagi committed Oct 18, 2024
1 parent 97af5af commit 6172581
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ENV STEAMAPP core-keeper
ENV STEAMAPPDIR "${HOMEDIR}/${STEAMAPP}-dedicated"
ENV STEAMAPPDATADIR "${HOMEDIR}/${STEAMAPP}-data"
ENV SCRIPTSDIR "${HOMEDIR}/scripts"
ENV MODSDIR "${STEAMAPPDATADIR}/StreamingAssets/Mods"
ENV DLURL https://raw.githubusercontent.com/escapingnetwork/core-keeper-dedicated

RUN dpkg --add-architecture i386
Expand All @@ -23,6 +24,7 @@ RUN set -x \
libxi6 \
tini \
tzdata \
gosu \
&& rm -rf /var/lib/apt/lists/*

# Setup X11 Sockets folder
Expand Down
2 changes: 1 addition & 1 deletion scripts/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi
if [ -f "/tmp/.X99-lock" ]; then rm /tmp/.X99-lock; fi

if [[ "$(id -u)" -eq 0 ]]; then
exec su "${USER}" -c "exec bash ${SCRIPTSDIR}/setup.sh"
exec gosu "${USER}" bash "${SCRIPTSDIR}/setup.sh"
else
exec bash "${SCRIPTSDIR}/setup.sh"
fi

0 comments on commit 6172581

Please sign in to comment.