From 47d2a6cf53e1fb950f81d03f75e8bf76c65d23f4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 7 Jun 2023 16:49:10 +0200 Subject: [run-virt-docker] Don't restart dockerd if not already running --- .../opt/openslx/pam/hooks/auth-final-exec.d/30-add-to-docker.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/modules/run-virt-docker') diff --git a/core/modules/run-virt-docker/data/opt/openslx/pam/hooks/auth-final-exec.d/30-add-to-docker.sh b/core/modules/run-virt-docker/data/opt/openslx/pam/hooks/auth-final-exec.d/30-add-to-docker.sh index 5490380a..53f0fc16 100755 --- a/core/modules/run-virt-docker/data/opt/openslx/pam/hooks/auth-final-exec.d/30-add-to-docker.sh +++ b/core/modules/run-virt-docker/data/opt/openslx/pam/hooks/auth-final-exec.d/30-add-to-docker.sh @@ -12,13 +12,13 @@ DOCKER_TMP="/tmp/docker" DOCKER_HOME="/tmp/virt/docker" rm -r -- "$DOCKER_HOME"/* -# This changes the subuid and subgid for the dockremap(user) to the current user and restards the docker daemon. +# This changes the subuid and subgid for the dockremap(user) to the current user and restarts the docker daemon. # Because off this change in the docker daemon, for each userns will be a directory under /tmp/virt/docker/ -# so new users cannot uses previously downloade images by other user. +# so new users cannot uses previously downloade images by other user. # But it saves the next user from using images, created by the previous user. sed -i "s/dockremap:[0-9]\+.65536/dockremap:$(id -u ${PAM_USER}):65536/g" /etc/subuid sed -i "s/dockremap:[0-9]\+.65536/dockremap:$(id -g ${PAM_USER}):65536/g" /etc/subgid -systemctl restart docker.service +systemctl --no-block try-restart docker.service exit 0 -- cgit v1.2.3-55-g7522