summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt-docker
diff options
context:
space:
mode:
authorSimon Rettberg2023-06-07 16:49:10 +0200
committerSimon Rettberg2023-06-07 16:49:10 +0200
commit47d2a6cf53e1fb950f81d03f75e8bf76c65d23f4 (patch)
tree1f58fa403bcd5fe07eda98eefc41e3b03ff2b956 /core/modules/run-virt-docker
parent[run-virt] Don't run DHCPd config generator/restarter unless we support runni... (diff)
downloadmltk-47d2a6cf53e1fb950f81d03f75e8bf76c65d23f4.tar.gz
mltk-47d2a6cf53e1fb950f81d03f75e8bf76c65d23f4.tar.xz
mltk-47d2a6cf53e1fb950f81d03f75e8bf76c65d23f4.zip
[run-virt-docker] Don't restart dockerd if not already running
Diffstat (limited to 'core/modules/run-virt-docker')
-rwxr-xr-xcore/modules/run-virt-docker/data/opt/openslx/pam/hooks/auth-final-exec.d/30-add-to-docker.sh6
1 files changed, 3 insertions, 3 deletions
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