Skip to content

Commit

Permalink
Use exec for binary execution
Browse files Browse the repository at this point in the history
Ensure that if run.sh is called directly with an existing mounted
/config, we can correctly execute the server.  This allows us to
manually set the uid/gid of steam and switch the entrypoint, causing the
server binary to be UID 1.  This allows graceful stopping of the server
when `docker stop` is issued.  Testing has unfortunately shown multiple
issues with propagating signals through the sudo call present in init.sh
  • Loading branch information
bewing committed Nov 30, 2021
1 parent fb66754 commit 5cb8740
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ else
printf "Skipping update as flag is set\\n"
fi

mkdir -p "${GAMECONFIGDIR}/Config/LinuxServer" "${GAMECONFIGDIR}/Logs" "${GAMECONFIGDIR}/SaveGames/server" "${GAMESAVESDIR}/server"
cp -a "/config/saves/." "/config/backups/"
cp -a "${GAMESAVESDIR}/server/." "/config/backups" # useless in first run, but useful in additional runs
rm -rf "${GAMESAVESDIR}/server"
Expand All @@ -51,4 +52,4 @@ fi

cd /config/gamefiles || exit 1

Engine/Binaries/Linux/UE4Server-Linux-Shipping FactoryGame -log -NoSteamClient -unattended ?listen -Port="$SERVERGAMEPORT" -BeaconPort="$SERVERBEACONPORT" -ServerQueryPort="$SERVERQUERYPORT" -multihome="$SERVERIP"
exec Engine/Binaries/Linux/UE4Server-Linux-Shipping FactoryGame -log -NoSteamClient -unattended ?listen -Port="$SERVERGAMEPORT" -BeaconPort="$SERVERBEACONPORT" -ServerQueryPort="$SERVERQUERYPORT" -multihome="$SERVERIP"

0 comments on commit 5cb8740

Please sign in to comment.