Skip to content

Commit

Permalink
[reboot] stop docker service before rebooting (sonic-net#423)
Browse files Browse the repository at this point in the history
* [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 <ying.xie@microsoft.com>

* [docker] always stop docker on all platforms

- add a protection of 30 seconds timeout.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
  • Loading branch information
yxieca committed Jan 10, 2019
1 parent 3ce8952 commit 220e269
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 220e269

Please sign in to comment.