From d9bca5ea5d4df2a1030f721378febb34f57ce71e Mon Sep 17 00:00:00 2001 From: raoulkramer <47716558+raoulkramer@users.noreply.github.com> Date: Sat, 6 Nov 2021 01:34:42 +0100 Subject: [PATCH] Remove a potentially pre-existing server.pid in entrypoint.sh (Merge pull request #4684) With this solution we don't need to amend the docker-compose.yml file. --- scripts/entrypoint.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index e3a7bede6..99496d910 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -13,5 +13,13 @@ usermod -g "$USER_GID" consul 2> /dev/null chown -R -h "$USER_UID" "$BUNDLE_PATH" chgrp -R -h "$USER_GID" "$BUNDLE_PATH" +# Remove a potentially pre-existing server.pid for Rails. +set -e + +if [ -f tmp/pids/server.pid ]; then + rm tmp/pids/server.pid +fi + +# Then exec the container's main process (what's set as CMD in the Dockerfile). /usr/bin/sudo -EH -u consul "$@"