Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
736c02c7
Commit
736c02c7
authored
Mar 30, 2016
by
Abhishek Shah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make docker-checker more robust
parent
56de2d11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
docker-checker.sh
cluster/saltbase/salt/supervisor/docker-checker.sh
+14
-3
No files found.
cluster/saltbase/salt/supervisor/docker-checker.sh
View file @
736c02c7
...
@@ -20,11 +20,22 @@
...
@@ -20,11 +20,22 @@
/etc/init.d/docker stop
/etc/init.d/docker stop
# Make sure docker gracefully terminated before start again
# Make sure docker gracefully terminated before start again
starttime
=
`
date
+%s
`
while
pidof docker
>
/dev/null
;
do
while
pidof docker
>
/dev/null
;
do
echo
"waiting clean shutdown"
currenttime
=
`
date
+%s
`
sleep
10
((
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
done
echo
"docker is not running. starting docker"
# cleanup docker network checkpoint to avoid running into known issue
# cleanup docker network checkpoint to avoid running into known issue
# of docker (https://github.com/docker/docker/issues/18283)
# of docker (https://github.com/docker/docker/issues/18283)
rm
-rf
/var/lib/docker/network
rm
-rf
/var/lib/docker/network
...
@@ -35,7 +46,7 @@ echo "waiting 30s for startup"
...
@@ -35,7 +46,7 @@ echo "waiting 30s for startup"
sleep
30
sleep
30
while
true
;
do
while
true
;
do
if
!
sudo timeout
10 docker version
>
/dev/null
;
then
if
!
timeout
60 docker ps
>
/dev/null
;
then
echo
"Docker failed!"
echo
"Docker failed!"
exit
2
exit
2
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment