Skip to content

Commit

Permalink
Merge pull request #23662 from ArtfulCoder/dockerscript
Browse files Browse the repository at this point in the history
make docker-checker more robust
  • Loading branch information
a-robinson committed Mar 31, 2016
2 parents 8e4ac19 + 736c02c commit d41d505
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions cluster/saltbase/salt/supervisor/docker-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,22 @@

/etc/init.d/docker stop
# Make sure docker gracefully terminated before start again
starttime=`date +%s`
while pidof docker > /dev/null; do
echo "waiting clean shutdown"
sleep 10
currenttime=`date +%s`
((elapsedtime = currenttime - starttime))
# after 60 seconds, forcefully terminate docker process
if test $elapsedtime -gt 60; then
echo "attempting to kill docker process with sigkill signal"
kill -9 `pidof docker` || sleep 10
else
echo "waiting clean shutdown"
sleep 10
fi
done

echo "docker is not running. starting docker"

# cleanup docker network checkpoint to avoid running into known issue
# of docker (https://github.com/docker/docker/issues/18283)
rm -rf /var/lib/docker/network
Expand All @@ -35,7 +46,7 @@ echo "waiting 30s for startup"
sleep 30

while true; do
if ! sudo timeout 10 docker version > /dev/null; then
if ! timeout 60 docker ps > /dev/null; then
echo "Docker failed!"
exit 2
fi
Expand Down

1 comment on commit d41d505

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 20298 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 267 Build time: 00:10:38

Please sign in to comment.