salt: Try 'systemctl' if 'service' command fails when restarting docker.

pull/6/head
Yifan Gu 2016-01-14 12:41:33 -08:00 committed by Yifan Gu
parent 3e04a45a95
commit 05087612b9
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ while true; do
if [[ $loadedImageFlags == 7 ]]; then break; fi
# Sometimes docker load hang, restart docker daemon resolve the issue
if [[ $restart_docker ]]; then service docker restart; fi
if [[ $restart_docker ]]; then
if ! service docker restart; then # Try systemctl if there's no service command.
systemctl restart docker
fi
fi
# sleep for 15 seconds before attempting to load docker images again
sleep 15