From 0e30b6ee555f8b72d9b02ee57f0d61fbe352a0fc Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 9 Sep 2021 15:24:35 +0200 Subject: [PATCH] lifecycle: fix worker startup error when docker socket's group is not called docker Signed-off-by: Jens Langhammer --- lifecycle/ak | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lifecycle/ak b/lifecycle/ak index 8ba483b88..79b6f05f6 100755 --- a/lifecycle/ak +++ b/lifecycle/ak @@ -14,9 +14,12 @@ function check_if_root { # Get group ID of the docker socket, so we can create a matching group and # add ourselves to it DOCKER_GID=$(stat -c '%g' $SOCKET) + # Ensure group for the id exists getent group $DOCKER_GID || groupadd -f -g $DOCKER_GID docker usermod -a -G $DOCKER_GID authentik - GROUP="authentik:docker" + # since the name of the group might not be docker, we need to lookup the group id + GROUP_NAME=$(getent group $DOCKER_GID | sed 's/:/\n/g' | head -1) + GROUP="authentik:${GROUP_NAME}" fi # Fix permissions of backups and media chown -R authentik:authentik /media /backups