Skip to content

Commit a6628ed

Browse files
committed
[docker-engine] fix systemd shutdown hang
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 docker/for-linux#421 there is a race between docker.service and containerd.service. docker needs containerd to properly stop the containers.
1 parent b3abf9a commit a6628ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build_debian.sh

+2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y remove software-properties-common
182182
sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/docker.service.d/
183183
## Note: $_ means last argument of last command
184184
sudo cp files/docker/docker.service.conf $_
185+
## Fix systemd race between docker and containerd
186+
sudo sed -i '/After=/s/$/ containerd.service/' $FILESYSTEM_ROOT/lib/systemd/system/docker.service
185187

186188
## Create default user
187189
## Note: user should be in the group with the same name, and also in sudo/docker group

0 commit comments

Comments
 (0)