Skip to content

Commit

Permalink
[docker-engine] fix systemd shutdown hang (#2451)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Staphylo authored and yxieca committed Jan 16, 2019
1 parent 0213dd4 commit d12d546
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d12d546

Please sign in to comment.