From 220e269e8334a89db5a2f931dea90e238feae7cc Mon Sep 17 00:00:00 2001 From: Ying Xie Date: Thu, 10 Jan 2019 14:31:22 -0800 Subject: [PATCH] [reboot] stop docker service before rebooting (#423) * [reboot] stop docker service before rebooting After upgrading to docker-ce 18.09.0. Shutdown SONiC takes 5-10 minutes waiting for all the running docker containers to quit. They all enventually hit the timeout and caused the huge delay. This is a work-around until proper solution is found. Signed-off-by: Ying Xie * [docker] always stop docker on all platforms - add a protection of 30 seconds timeout. Signed-off-by: Ying Xie --- scripts/reboot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/reboot b/scripts/reboot index 7f3354242faa..4d34cab3db12 100755 --- a/scripts/reboot +++ b/scripts/reboot @@ -15,6 +15,10 @@ function stop_sonic_services() docker exec -i syncd /usr/bin/syncd_request_shutdown --cold > /dev/null sleep 3 fi + + # Stop docker service to avoid 5-10 minutes delay in shutdown + # while waiting for existing docker containers to quit. + timeout 30s systemctl stop docker } function clear_warm_boot()