I am proposing to change the behavior of `dnf needs-restarting` in DNF 5, and I'd like
to know whether anyone has strong feelings about that plugin.
In short, I would like to make `dnf5 needs-restarting` function like `dnf needs-restarting
-r` currently does: report whether the system requires a reboot rather than list processes
that need restarting. I also think we should move away from DNF 4's approach of
finding open outdated files and instead consider (1) advisories tagged as
"reboot_suggested" and (2) running services that depend on files from
Here are some more details, copied from
- `dnf5 needs-restarting` (no flag): I'd like this to simply report whether the system
needs to be restarted. If there are "core packages" (such as kernel or glibc)
that have been updated since boot, or if any advisory with the `reboot_suggested` flag
applies to any of the packages that have been updated/installed since boot, `dnf5
needs-restarting` will list these packages and exit with code 1 to indicate a reboot is
needed. Otherwise, it will exit with code 0. This proposed behavior is the same as the
current behavior of `dnf4 needs-restarting -r`, but it would properly honor the
`reboot_suggested` advisory rather than simply checking the hardcoded list of "core
I think this should be the default behavior of needs-restarting (rather than being behind
a flag) because it's probably the most common use case. Here's an example of a
user running `needs-restarting` when they needed `needs-restarting -r` .
- Regarding the behavior of `dnf4 needs-restarting` (no flag): currently, this command
lists processes with open outdated files and recommends the user restart them. I think we
should leave this behavior out of dnf5 needs-restarting for two reasons. First, tracer 
and `dnf-plugins-extras-tracer` implement this approach well, and we don't need to
duplicate their functionality. Second, this whole strategy of looking for open files is a
bit of a hack and IMO shouldn't be included in the core DNF plugins. It might work
most of the time, but there are nuances and edge cases here, e.g. when a process maps a
library without opening it , or if, hypothetically, a process reads a file into memory,
closes it, then encrypts the copy in memory. There's just no way to tell that the
process is "using" that outdated file.
- `dnf5 needs-restarting -s`: I'd like this to list systemd services that need to be
restarted, but rather than check whether the service has any open outdated files, check
the dependencies of the package that provides the service.