DNF 5 needs-restarting: make `-r` the default, respect reboot_suggested advisory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 recently-updated packages.

Here are some more details, copied from https://github.com/rpm-software-management/dnf5/pull/887:

- `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 packages".

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` [0].

- 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 [1] 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 [2], 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.

[0] https://bugzilla.redhat.com/show_bug.cgi?id=2237223
[1] https://github.com/FrostyX/tracer
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1131307
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux