From 30b64fa533351f9fcfa65d535156e46b85281199 Mon Sep 17 00:00:00 2001 From: Daniel Fallon Date: Mon, 11 Jun 2018 13:46:25 -0500 Subject: [PATCH] Correctly set file ownership on startup --- 0.X/docker-entrypoint.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/0.X/docker-entrypoint.sh b/0.X/docker-entrypoint.sh index a16d01a..ecc35c6 100755 --- a/0.X/docker-entrypoint.sh +++ b/0.X/docker-entrypoint.sh @@ -65,20 +65,9 @@ fi # If we are running Vault, make sure it executes as the proper user. if [ "$1" = 'vault' ]; then - # If the config dir is bind mounted then chown it - if [ "$(stat -c %u /vault/config)" != "$(id -u vault)" ]; then - chown -R vault:vault /vault/config || echo "Could not chown /vault/config (may not have appropriate permissions)" - fi - - # If the logs dir is bind mounted then chown it - if [ "$(stat -c %u /vault/logs)" != "$(id -u vault)" ]; then - chown -R vault:vault /vault/logs - fi - # If the file dir is bind mounted then chown it - if [ "$(stat -c %u /vault/file)" != "$(id -u vault)" ]; then - chown -R vault:vault /vault/file - fi + # Ensure all of our permissions are set properly + chown -R vault:vault /vault || echo "Could not chown /vault (may not have appropriate permissions)" if [ -z "$SKIP_SETCAP" ]; then # Allow mlock to avoid swapping Vault memory to disk