From 934e62d5be2154255f8f6fcee507e67e33c892fd Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 13 May 2021 22:55:35 +0200 Subject: [PATCH] lifecycle: fix error when worker is not running as root Signed-off-by: Jens Langhammer --- lifecycle/bootstrap.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lifecycle/bootstrap.sh b/lifecycle/bootstrap.sh index fa0fe2be5..bfda8dba7 100755 --- a/lifecycle/bootstrap.sh +++ b/lifecycle/bootstrap.sh @@ -5,6 +5,7 @@ printf '{"event": "Bootstrap completed", "level": "info", "logger": "bootstrap", function check_if_root { if [[ $EUID -ne 0 ]]; then printf '{"event": "Not running as root, disabling permission fixes", "level": "info", "logger": "bootstrap", "command": "%s"}\n' "$@" > /dev/stderr + $1 return fi SOCKET="/var/run/docker.sock" @@ -16,14 +17,14 @@ function check_if_root { fi # Fix permissions of backups and media chown -R authentik:authentik /media /backups + chpst -u authentik env HOME=/authentik $1 } if [[ "$1" == "server" ]]; then python -m lifecycle.migrate /authentik-proxy elif [[ "$1" == "worker" ]]; then - check_if_root - chpst -u authentik env HOME=/authentik celery -A authentik.root.celery worker --autoscale 3,1 -E -B -s /tmp/celerybeat-schedule -Q authentik,authentik_scheduled,authentik_events + check_if_root "celery -A authentik.root.celery worker --autoscale 3,1 -E -B -s /tmp/celerybeat-schedule -Q authentik,authentik_scheduled,authentik_events" elif [[ "$1" == "backup" ]]; then python -m manage dbbackup --clean elif [[ "$1" == "restore" ]]; then