From bfe46e0f1dd1b1e4769317ec46e31e8ada4d2dba Mon Sep 17 00:00:00 2001 From: Samuel Angebault Date: Wed, 16 Jan 2019 01:54:14 -0800 Subject: [PATCH] [docker-engine] fix systemd shutdown hang (#2451) When rebooting without the platform_reboot plugin, systemd takes a few minutes to properly shutdown. It's blocking on some docker cleanup operation. As described by https://github.com/docker/for-linux/issues/421 there is a race between docker.service and containerd.service. docker needs containerd to properly stop the containers. --- build_debian.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build_debian.sh b/build_debian.sh index 8c69a922bfe7..1f258193b2da 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -182,6 +182,8 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/docker.service.d/ ## Note: $_ means last argument of last command sudo cp files/docker/docker.service.conf $_ +## Fix systemd race between docker and containerd +sudo sed -i '/After=/s/$/ containerd.service/' $FILESYSTEM_ROOT/lib/systemd/system/docker.service ## Create default user ## Note: user should be in the group with the same name, and also in sudo/docker group