Repository navigation
use dnf needs-restarting for rpm reboot detection - #877
Open
KrBeTect2025 wants to merge 1 commit into
Open
KrBeTect2025 wants to merge 1 commit into
KrBeTect2025 wants to merge 1 commit into
Conversation
On RHEL 8/9 /boot/vmlinuz is often not a symlink, so the client fell back to ServerCheck, which protocol 2 sends as reboot_required: false. Hosts running an older kernel than the newest installed one were shown as not needing a reboot. When dnf is available, ask `dnf needs-restarting -r`, which also covers core libraries such as glibc and systemd. dnf exits 1 both when a reboot is required and on errors such as the needs-restarting plugin not being installed, so exit 1 only counts when the output says a reboot is required. Any other result falls back to the existing checks. Fixes furlongm#864
This branch has not been deployed
This file contains hidden or 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
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.
On RHEL 8/9
/boot/vmlinuzis usually not a symlink, soreboot_required()falls back toServerCheck, which protocol 2 sends asreboot_required: false. Hosts running an older kernel than the newest installed one show as not needing a reboot.When dnf is available the client now runs
dnf needs-restarting -r. dnf also exits 1 on errors, for example when the needs-restarting plugin is not installed (stock Rocky 9 prints "No such command"), so exit 1 only counts as a reboot when the output says "Reboot is required". dnf runs withLC_ALL=Cso the match works on translated systems. Exit 0 means no reboot; anything else falls back to the existing checks.Tested by running the updated
reboot_required()against real dnf in containers:ServerCheck, as beforeFalseTrueFalse./manage.py test, flake8 and isort pass.Fixes #864