Describe the bug
dnf needs-restarting -r never reports a reboot as required after a kernel-only
update on AL2023, even when a newer kernel6.12 build is installed and confirmed
as the next-boot kernel via grubby. Root cause: AL2023's packaged
dnf-plugins-core (currently 4.3.0-13.amzn2023.0.6, latest available in the
amazonlinux repo as of this writing) predates an upstream fix for exactly this
scenario, released in dnf-plugins-core 4.8.0.
Root cause
needs_restarting.py's reboot-hint logic matches installed packages against a
hardcoded list:
NEED_REBOOT = ['kernel', 'kernel-rt', 'glibc', 'linux-firmware',
'systemd', 'dbus', 'dbus-broker', 'dbus-daemon',
'microcode_ctl']
In AL2023's shipped version (4.3.0), the match is by literal package name:
for pkg in installed.filter(name=NEED_REBOOT):
AL2023 names its kernel package kernel6.12 (major version embedded, to allow
side-by-side kernel installs) — that string is never literally 'kernel', so a
kernel update is invisible to this check, regardless of provides.
Upstream already fixed this in commit
c989427d53
("needs-restarting: detect packages providing NEED_REBOOT", released in
4.8.0), changing the match to provides-based:
for pkg in installed.filter(provides=NEED_REBOOT):
The commit message: "This allows the 'needs-restarting' plugin to detect if any
alternative kernels have been installed/updated since the system last booted."
— our exact scenario. We confirmed live that kernel6.12 does correctly
Provide: kernel = <version>, so the provides-based match would work correctly
on AL2023 today if the newer plugin were packaged.
To Reproduce (live-tested on an AL2023 EKS worker node)
- Node has two
kernel6.12 NEVRAs installed side by side (normal AL2023
pattern): the running one, and a newer one installed well after last boot.
rpm -q kernel6.12 --qf '%{VERSION}-%{RELEASE} installed:%{INSTALLTIME:date}\n'
6.12.68-92.122.amzn2023 installed:Fri Feb 13 16:07:15 2026
6.12.95-124.187.amzn2023 installed:Tue Aug 11 12:12:00 2026
uname -r → 6.12.68-92.122.amzn2023.x86_64 (still running the old one)
- Boot time (
uptime -s) → 2026-03-24 18:00:13 — clearly before the newer
kernel's install time.
grubby --default-kernel → /boot/vmlinuz-6.12.95-124.187.amzn2023.x86_64
— correctly identifies the newer kernel as next-boot.
rpm -q --whatprovides kernel → returns both installed kernel6.12
packages, confirming both declare Provides: kernel.
dnf needs-restarting -r:
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.
— incorrect. Confirmed via direct hawkey query
(base.sack.query().installed().filter(provides=NEED_REBOOT)) that the
provides-based match does correctly return the newer kernel package with
the right installtime — the only thing preventing detection is that the
installed plugin still filters by name=, not provides=.
Expected behavior
dnf needs-restarting -r should exit 1 (reboot required) once a newer
kernel6.12 build is installed after the current boot, matching upstream
dnf-plugins-core 4.8.0+ behavior.
Additional context
dnf --version: 4.14.0
rpm -q dnf-plugins-core: dnf-plugins-core-4.3.0-13.amzn2023.0.6
- Confirmed via
dnf --refresh repoquery --available dnf-plugins-core against
the live amazonlinux repo that 4.3.0-13.amzn2023.0.6 is the newest version
currently packaged — this isn't a node/instance staleness issue, AL2023 hasn't
shipped the fix at all yet.
- Impact: any automation relying on
needs-restarting -r's exit code to decide
whether to reboot a node for kernel updates (e.g. kured, configured with
rebootSentinelCommand: needs-restarting -r) silently never reboots for
kernel-only updates on AL2023 — worse than a false positive, since nodes
accumulate unapplied kernel security patches indefinitely while reporting
"reboot should not be necessary."
- Requesting: update/backport
dnf-plugins-core past 4.8.0 (or backport just
commit c989427d53) into AL2023's repos.
Describe the bug
dnf needs-restarting -rnever reports a reboot as required after a kernel-onlyupdate on AL2023, even when a newer
kernel6.12build is installed and confirmedas the next-boot kernel via
grubby. Root cause: AL2023's packageddnf-plugins-core(currently4.3.0-13.amzn2023.0.6, latest available in theamazonlinuxrepo as of this writing) predates an upstream fix for exactly thisscenario, released in
dnf-plugins-core4.8.0.Root cause
needs_restarting.py's reboot-hint logic matches installed packages against ahardcoded list:
In AL2023's shipped version (4.3.0), the match is by literal package name:
AL2023 names its kernel package
kernel6.12(major version embedded, to allowside-by-side kernel installs) — that string is never literally
'kernel', so akernel update is invisible to this check, regardless of provides.
Upstream already fixed this in commit
c989427d53("needs-restarting: detect packages providing NEED_REBOOT", released in
4.8.0), changing the match to provides-based:
The commit message: "This allows the 'needs-restarting' plugin to detect if any
alternative kernels have been installed/updated since the system last booted."
— our exact scenario. We confirmed live that
kernel6.12does correctlyProvide: kernel = <version>, so the provides-based match would work correctlyon AL2023 today if the newer plugin were packaged.
To Reproduce (live-tested on an AL2023 EKS worker node)
kernel6.12NEVRAs installed side by side (normal AL2023pattern): the running one, and a newer one installed well after last boot.
uname -r→6.12.68-92.122.amzn2023.x86_64(still running the old one)uptime -s) →2026-03-24 18:00:13— clearly before the newerkernel's install time.
grubby --default-kernel→/boot/vmlinuz-6.12.95-124.187.amzn2023.x86_64— correctly identifies the newer kernel as next-boot.
rpm -q --whatprovides kernel→ returns both installedkernel6.12packages, confirming both declare
Provides: kernel.dnf needs-restarting -r:(
base.sack.query().installed().filter(provides=NEED_REBOOT)) that theprovides-based match does correctly return the newer kernel package with
the right
installtime— the only thing preventing detection is that theinstalled plugin still filters by
name=, notprovides=.Expected behavior
dnf needs-restarting -rshould exit 1 (reboot required) once a newerkernel6.12build is installed after the current boot, matching upstreamdnf-plugins-core4.8.0+ behavior.Additional context
dnf --version:4.14.0rpm -q dnf-plugins-core:dnf-plugins-core-4.3.0-13.amzn2023.0.6dnf --refresh repoquery --available dnf-plugins-coreagainstthe live
amazonlinuxrepo that4.3.0-13.amzn2023.0.6is the newest versioncurrently packaged — this isn't a node/instance staleness issue, AL2023 hasn't
shipped the fix at all yet.
needs-restarting -r's exit code to decidewhether to reboot a node for kernel updates (e.g.
kured, configured withrebootSentinelCommand: needs-restarting -r) silently never reboots forkernel-only updates on AL2023 — worse than a false positive, since nodes
accumulate unapplied kernel security patches indefinitely while reporting
"reboot should not be necessary."
dnf-plugins-corepast 4.8.0 (or backport justcommit
c989427d53) into AL2023's repos.