diff options
author | Eirk Nygaard <eirik.nygaard@yahooinc.com> | 2022-10-20 10:49:35 +0000 |
---|---|---|
committer | Eirk Nygaard <eirik.nygaard@yahooinc.com> | 2022-10-21 12:19:02 +0000 |
commit | 604af1235637971912bdc36d79decbac3bffe1bb (patch) | |
tree | fe087bb411b7e2d219b6cf0962ba555865c11671 /metrics-proxy | |
parent | d585895070d794ac4535e49b72d8d4b8a30f49ae (diff) |
Support running Vespa in container as non-root
This removes the old VESPA_UNPRIVILEGED environment variable. Instead we use
the old mechanisme if id of the user starting Vespa is root. If the container
is started with a non-root user some sanity checking is done to either fail
because wrong permissions are active, or warn the user for possibly too low
limits.
Diffstat (limited to 'metrics-proxy')
-rw-r--r-- | metrics-proxy/src/main/sh/start-telegraf.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/metrics-proxy/src/main/sh/start-telegraf.sh b/metrics-proxy/src/main/sh/start-telegraf.sh index ca6549de5f8..0cdfd784367 100644 --- a/metrics-proxy/src/main/sh/start-telegraf.sh +++ b/metrics-proxy/src/main/sh/start-telegraf.sh @@ -79,7 +79,7 @@ fixddir () { echo "Creating data directory $1" mkdir -p $1 || exit 1 fi - if [ "${VESPA_USER}" ] && [ "${VESPA_UNPRIVILEGED}" != yes ]; then + if [ "${VESPA_USER}" ] && [ "$(id -u)" -eq 0 ]; then chown ${VESPA_USER} $1 fi chmod 755 $1 |