projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '21815-trigrams-exclude-ids'
[arvados.git]
/
tools
/
compute-images
/
scripts
/
usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh
diff --git
a/tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh
b/tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh
index 4b73c8bc4ff643e41cf6e707526458b32b03c597..d9790fb45ce6e2d334d64b64d72f843e30378f33 100644
(file)
--- a/
tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh
+++ b/
tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh
@@
-22,14
+22,21
@@
ensure_umount() {
# 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
- service docker stop || 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"
-/bin/bash /opt/amazon-ebs-autoscale/install.sh -f lvm.ext4 -m $MOUNTPATH 2>&1 > /var/log/ebs-autoscale-install.log
+/bin/bash /opt/amazon-ebs-autoscale/install.sh -
-imdsv2 -
f lvm.ext4 -m $MOUNTPATH 2>&1 > /var/log/ebs-autoscale-install.log
# Make sure docker uses the big partition
cat <<EOF > /etc/docker/daemon.json
# Make sure docker uses the big partition
cat <<EOF > /etc/docker/daemon.json
@@
-38,13
+45,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
- s
ervice docker start
+ s
ystemctl start docker.service docker.socket || true
fi
end=$((SECONDS+60))
fi
end=$((SECONDS+60))