This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 558
add retries for systemctl commands #2639
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,8 +249,8 @@ function installClearContainersRuntime() { | |
|
||
# Enable and start Clear Containers proxy service | ||
echo "Enabling and starting Clear Containers proxy service..." | ||
systemctl enable cc-proxy | ||
systemctl start cc-proxy | ||
systemctlEnableAndCheck cc-proxy | ||
retrycmd_if_failure 100 1 10 systemctl daemon-reload && systemctl restart cc-proxy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
|
||
setKubeletOpts " --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock" | ||
} | ||
|
@@ -290,7 +290,7 @@ function ensureContainerd() { | |
# Make sure this is done after networking plugins are installed | ||
echo "Enabling and starting cri-containerd service..." | ||
systemctl enable containerd | ||
systemctl start containerd | ||
retrycmd_if_failure 100 1 10 systemctl daemon-reload && systemctl restart containerd | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
fi | ||
fi | ||
} | ||
|
@@ -321,31 +321,15 @@ function ensureDocker() { | |
systemctlEnableAndCheck docker | ||
# only start if a reboot is not required | ||
if ! $REBOOTREQUIRED; then | ||
dockerStarted=1 | ||
for i in {1..900}; do | ||
if ! timeout 10s $DOCKER info; then | ||
echo "status $?" | ||
timeout 60s /bin/systemctl restart docker | ||
else | ||
echo "docker started, took $i seconds" | ||
dockerStarted=0 | ||
break | ||
fi | ||
sleep 1 | ||
done | ||
if [ $dockerStarted -ne 0 ] | ||
then | ||
echo "docker did not start" | ||
exit 2 | ||
fi | ||
retrycmd_if_failure 900 1 60 systemctl daemon-reload && systemctl restart docker | ||
fi | ||
} | ||
|
||
function ensureKubelet() { | ||
systemctlEnableAndCheck kubelet | ||
# only start if a reboot is not required | ||
if ! $REBOOTREQUIRED; then | ||
systemctl restart kubelet | ||
retrycmd_if_failure 100 1 10 systemctl daemon-reload && systemctl restart kubelet | ||
fi | ||
} | ||
|
||
|
@@ -354,7 +338,7 @@ function extractHyperkube(){ | |
systemctlEnableAndCheck hyperkube-extract | ||
# only start if a reboot is not required | ||
if ! $REBOOTREQUIRED; then | ||
systemctl restart hyperkube-extract | ||
retrycmd_if_failure 100 1 10 systemctl daemon-reload && systemctl restart hyperkube-extract | ||
fi | ||
} | ||
|
||
|
@@ -367,7 +351,7 @@ function ensureJournal(){ | |
echo "ForwardToSyslog=no" >> /etc/systemd/journald.conf | ||
# only start if a reboot is not required | ||
if ! $REBOOTREQUIRED; then | ||
systemctl restart systemd-journald.service | ||
retrycmd_if_failure 100 1 10 systemctl daemon-reload && systemctl restart systemd-journald.service | ||
fi | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jessfraz FYI