projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merge 21447: closes #21447
[arvados.git]
/
tools
/
compute-images
/
scripts
/
usr-local-bin-ensure-encrypted-partitions.sh
diff --git
a/tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions.sh
b/tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions.sh
index a76dc121096527101ee5c35e2434625d205252fb..726ff0cdcd4d20ff308e32d69edc7a054bd2af1b 100644
(file)
--- a/
tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions.sh
+++ b/
tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions.sh
@@
-119,9
+119,16
@@
mkfs.xfs -f "$CRYPTPATH"
# First make sure docker is not using /tmp, then unmount everything under it.
if [ -d /etc/sv/docker.io ]
then
# First make sure docker is not using /tmp, then unmount everything under it.
if [ -d /etc/sv/docker.io ]
then
+ # TODO: Actually detect Docker state with runit
+ DOCKER_ACTIVE=true
sv stop docker.io || service stop docker.io || true
else
sv stop docker.io || service stop docker.io || true
else
- systemctl disable --now docker.service docker.socket || true
+ if systemctl --quiet is-active docker.service docker.socket; then
+ systemctl stop docker.service docker.socket || true
+ DOCKER_ACTIVE=true
+ else
+ DOCKER_ACTIVE=false
+ fi
fi
ensure_umount "$MOUNTPATH/docker/aufs"
fi
ensure_umount "$MOUNTPATH/docker/aufs"
@@
-137,13
+144,18
@@
cat <<EOF > /etc/docker/daemon.json
}
EOF
}
EOF
+if ! $DOCKER_ACTIVE; then
+ # Nothing else to do
+ exit 0
+fi
+
# restart docker
if [ -d /etc/sv/docker.io ]
then
## runit
sv up docker.io
else
# restart docker
if [ -d /etc/sv/docker.io ]
then
## runit
sv up docker.io
else
- systemctl
enable --now
docker.service docker.socket || true
+ systemctl
start
docker.service docker.socket || true
fi
end=$((SECONDS+60))
fi
end=$((SECONDS+60))