-
Notifications
You must be signed in to change notification settings - Fork 789
Avoid boot loop when there are dnf network issues #4442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,15 +5,21 @@ | |
|
|
||
| set -eux | ||
|
|
||
| [ "$LIMA_CIDATA_UPGRADE_PACKAGES" = "1" ] || exit 0 | ||
|
|
||
| # Check if cloud-init forgot to reboot_if_required | ||
| # (only implemented for apt at the moment, not dnf) | ||
|
|
||
| if command -v dnf >/dev/null 2>&1; then | ||
| # dnf-utils needs to be installed, for needs-restarting | ||
| if dnf -h needs-restarting >/dev/null 2>&1; then | ||
| # needs-restarting returns "false" if needed (!) | ||
| if ! dnf needs-restarting -r >/dev/null 2>&1; then | ||
| systemctl reboot | ||
| # check-update returns "false" (100) if updates (!) | ||
| dnf check-update >/dev/null | ||
| if [ "$?" != "1" ]; then | ||
| # needs-restarting returns "false" if needed (!) | ||
| if ! dnf needs-restarting -r; then | ||
|
Member
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. If the command fails due to other reasons, this results in reboot loop too?
Member
Author
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. The exit codes are hopelessly confused, scraping the plugin output could make it worse But I think it is possible, as long as you select the
Member
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. When the output is unclear it should default to avoid the potential reboot loop |
||
| systemctl reboot | ||
| fi | ||
| fi | ||
| fi | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.