From afbdfea0bbb61af101327df3c08af3a0da1c0e79 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sun, 13 Oct 2024 15:05:49 -0500 Subject: [PATCH] Add SKIP_CHOWN_DATA to skip the "Changing ownership of /data" (#3103) --- docs/misc/troubleshooting.md | 2 ++ scripts/start | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/misc/troubleshooting.md b/docs/misc/troubleshooting.md index 22d90795..21a4d377 100644 --- a/docs/misc/troubleshooting.md +++ b/docs/misc/troubleshooting.md @@ -3,3 +3,5 @@ To troubleshoot the container initialization, such as when server files are pre- To troubleshoot just the command-line used to start the Minecraft server, set the environment variable `DEBUG_EXEC` to `true`. To troubleshoot any issues with memory allocation reported by the JVM, set the environment variable `DEBUG_MEMORY` to `true`. + +If you are experiencing any issues with the "Changing ownership of /data" step, that can be disabled by setting `SKIP_CHOWN_DATA` to `true`. diff --git a/scripts/start b/scripts/start index 16b389e6..9d45a9a7 100755 --- a/scripts/start +++ b/scripts/start @@ -6,6 +6,7 @@ # The Dockerfile ENVs take precedence here, but defaulting for testing consistency : "${UID:=1000}" : "${GID:=1000}" +: "${SKIP_CHOWN_DATA:=false}" umask "${UMASK:=0002}" @@ -38,7 +39,7 @@ if ! isTrue "${SKIP_SUDO:-false}" && [ "$(id -u)" = 0 ]; then fi fi - if [[ $(stat -c "%u" /data) != "$UID" ]]; then + if isTrue "${SKIP_CHOWN_DATA}" || [[ $(stat -c "%u" /data) != "$UID" ]]; then log "Changing ownership of /data to $UID ..." chown -R ${runAsUser}:${runAsGroup} /data fi