Skip to content

Commit

Permalink
Fix exec function when running the container as root
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanpommier committed Sep 25, 2024
1 parent 245d346 commit a306878
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ if [ -n "$GEOSERVER_ADMIN_PASSWORD" ] && [ -n "$GEOSERVER_ADMIN_USER" ]; then
fi

# Run as non-privileged user
if [ "${RUN_UNPRIVILEGED}" = "true" ]; then
if [ "${RUN_UNPRIVILEGED}" = "true" ]
then
echo "The server will be run as non-privileged user 'tomcat'"

RUN_WITH_USER_UID=${RUN_WITH_USER_UID:=999}
Expand All @@ -183,7 +184,9 @@ if [ "${RUN_UNPRIVILEGED}" = "true" ]; then
echo "Changing ownership accordingly ($CHANGE_OWNERSHIP_ON_FOLDERS)"
chown -R tomcat:tomcat $CHANGE_OWNERSHIP_ON_FOLDERS
fi


exec gosu tomcat $CATALINA_HOME/bin/catalina.sh run -Dorg.apache.catalina.connector.RECYCLE_FACADES=true
else
exec $CATALINA_HOME/bin/catalina.sh run -Dorg.apache.catalina.connector.RECYCLE_FACADES=true
fi

exec gosu tomcat $CATALINA_HOME/bin/catalina.sh run -Dorg.apache.catalina.connector.RECYCLE_FACADES=true

0 comments on commit a306878

Please sign in to comment.