From a03fad2c335348af7ea3cec1845e613a9ef0dbf7 Mon Sep 17 00:00:00 2001 From: szaimen Date: Thu, 27 Oct 2022 16:11:09 +0200 Subject: [PATCH] fix sudo command Signed-off-by: szaimen --- Containers/nextcloud/Dockerfile | 2 +- Containers/nextcloud/notify.sh | 2 +- Containers/nextcloud/start.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Containers/nextcloud/Dockerfile b/Containers/nextcloud/Dockerfile index 4a68eb3e..94ea63b0 100644 --- a/Containers/nextcloud/Dockerfile +++ b/Containers/nextcloud/Dockerfile @@ -253,6 +253,6 @@ RUN echo "root:$(openssl rand -base64 12)" | chpasswd USER root ENTRYPOINT ["/start.sh"] -CMD ["sudo", "-uE", "www-data", "/usr/bin/supervisord", "-c", "/supervisord.conf"] +CMD ["sudo", "-E", "-u", "www-data", "/usr/bin/supervisord", "-c", "/supervisord.conf"] HEALTHCHECK CMD (sudo -u www-data nc -z localhost 9000 && sudo -u www-data nc -z localhost 7867) || exit 1 \ No newline at end of file diff --git a/Containers/nextcloud/notify.sh b/Containers/nextcloud/notify.sh index 71768a23..f782f315 100644 --- a/Containers/nextcloud/notify.sh +++ b/Containers/nextcloud/notify.sh @@ -1,7 +1,7 @@ #!/bin/bash if [[ "$EUID" = 0 ]]; then - sudo -u www-data -sE + sudo -u www-data -s -E fi SUBJECT="$1" diff --git a/Containers/nextcloud/start.sh b/Containers/nextcloud/start.sh index 53bf29b0..8dcdb148 100644 --- a/Containers/nextcloud/start.sh +++ b/Containers/nextcloud/start.sh @@ -37,7 +37,7 @@ fi sudo -u www-data rm -f "$NEXTCLOUD_DATA_DIR/this-is-a-test-file" # Run original entrypoint -if ! sudo -uE www-data bash /entrypoint.sh; then +if ! sudo -E -u www-data bash /entrypoint.sh; then exit 1 fi