-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
packagekit: Use dnf-automatic reboot option if available #19648
Merged
Merged
Conversation
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
martinpitt
force-pushed
the
dnf-automatic-reboot
branch
from
November 23, 2023 09:22
7a6e0d6
to
7b9a5bc
Compare
Commit 5eacb70 silently disabled TestAutoUpdates, as the skipOstree() decorator requires an argument.
In all other components we just treat this as a boolean. This is passed from `superuser.allowed`, which is `null` while it is being initialized. React complains about that: > The prop `privileged` is marked as required in `KpatchSettings`, but its value is `null` Do what other components do and don't mark this as required, so that it tolerates `null`. This was hidden because TestAutoUpdates haven't run for a while (see previous commit).
…tes() testWithAvailableUpdates() is the only caller, and the helper makes assumptions about the setup.
dnf 4.15 introduced a `reboot` option for automatic updates at last [1][2]. This is available in all current Fedoras and RHEL 9.3+, but not yet in RHEL 8. On systems which support it (i.e. which have a `reboot=` option in automatic.conf), set that to "when-needed" instead of the unit drop-in hack. Remove the latter to clean up on upgrades; that will only have an effect if the admin disables and re-enables automatic updates, but that's better than nothing. In testWithAvailableUpdates(), adjust the mocked package name to "kernel-rt", to match dnf's hardcoded list in base.py `reboot_needed()`. Also increase the number of journal lines to make sure that the message doesn't "scroll off". Fixes https://issues.redhat.com/browse/RHEL-16392 [1] https://github.com/rpm-software-management/dnf/blob/master/doc/automatic.rst#commands-section [2] https://bugzilla.redhat.com/show_bug.cgi?id=1491190
martinpitt
force-pushed
the
dnf-automatic-reboot
branch
from
November 23, 2023 10:32
7b9a5bc
to
b2975cb
Compare
Ugh, fallout from disabled TestAutoUpdates, fixed. |
jelly
approved these changes
Nov 23, 2023
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.
Thanks!
"if systemctl status --no-pager --lines=100 dnf-automatic-install.service| grep -q ===========$$; then " + | ||
"shutdown -r +5 rebooting after applying package updates; fi\"\\n' > " + rebootConf + "; "; | ||
script += "systemctl daemon-reload; "; | ||
script += " systemctl daemon-reload; "; | ||
script += "fi"; |
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.
Less hacks \o/ Wonder if we should move to string literals at some point for readability.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
dnf 4.15 introduced a
reboot
option for automatic updates at last[1][2]. This is available in all current Fedoras and RHEL 9.3+, but not
yet in RHEL 8. On systems which support it (i.e. which have a
reboot=
option in automatic.conf), set that to "when-needed" instead of the
unit drop-in hack. Remove the latter to clean up on upgrades; that will
only have an effect if the admin disables and re-enables automatic
updates, but that's better than nothing.
Fixes https://issues.redhat.com/browse/RHEL-16392
[1] https://github.com/rpm-software-management/dnf/blob/master/doc/automatic.rst#commands-section
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1491190
I tested this interactively on a real F39 machine with lots of pending updates (including a kernel), waited for the timer to trigger, and eventually:
So this works nicely!