3 # Copyright (C) The Arvados Authors. All rights reserved.
5 # SPDX-License-Identifier: Apache-2.0
13 findmnt "$@" >/dev/null
17 if findmntq "$1"; then
22 # First make sure docker is not using /tmp, then unmount everything under it.
23 if [ -d /etc/sv/docker.io ]
25 # TODO: Actually detect Docker state with runit
27 sv stop docker.io || service stop docker.io || true
29 if systemctl --quiet is-active docker.service docker.socket; then
30 systemctl stop docker.service docker.socket || true
37 ensure_umount "$MOUNTPATH/docker/aufs"
39 /bin/bash /opt/amazon-ebs-autoscale/install.sh --imdsv2 -f lvm.ext4 -m $MOUNTPATH 2>&1 > /var/log/ebs-autoscale-install.log
41 # Make sure docker uses the big partition
42 cat <<EOF > /etc/docker/daemon.json
44 "data-root": "$MOUNTPATH/docker-data"
48 if ! $DOCKER_ACTIVE; then
54 if [ -d /etc/sv/docker.io ]
59 systemctl start docker.service docker.socket || true
64 while [ $SECONDS -lt $end ]; do
65 if /usr/bin/docker ps -q >/dev/null; then
71 # Docker didn't start within a minute, abort