Bug 2164835
| Summary: | [RFE] Request method to inspect RPM package if it requires a system reboot before install | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Hakyong Do <hdo> |
| Component: | dnf | Assignee: | Evan Goode <egoode> |
| Status: | CLOSED WONTFIX | QA Contact: | swm-qe |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 9.4 | CC: | casantos, egoode, james.antill |
| Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-07-12 19:11:22 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Comment 5
Evan Goode
2023-02-13 15:38:09 UTC
Hi, Thank you for your response. What customer want is they need method to identify packages which will require a reboot before installing it. The CU doesn't matter the functionality available in the command-line or API. The reason why they need this functionality is they want postpone installing packages that require system reboot later and keep their service online to meet their SLA. If they are able to identify those packages, they will schedule another maintenance window to rebooting systems. Thank you Hakyong Do As I understand it, the change which adds this functionality has already been merged due to https://bugzilla.redhat.com/show_bug.cgi?id=2124793, but it is not yet documented. I just opened https://github.com/rpm-software-management/dnf/pull/1906 to document it. Once the changes land in RHEL, the customer should be able to use something like this Python snippet to detect whether installing a package will require a reboot: ``` import dnf package = "glibc" base = dnf.Base() base.read_all_repos() base.fill_sack() base.install_specs([package]) base.resolve() # Is reboot needed? if base.reboot_needed(): print("Reboot is recommended") elif: print("Reboot should not be necessary") ``` We still need to decide an expected target version of arrival in RHEL. I have another suggestion. The method `reboot_needed()` uses static list of packages that might require reboot, but this is not the best approach that we can use. In advisory there is a suggestion field that could propose a reboot - `<reboot_suggested>True</reboot_suggested>`. We might use that information to provide a suggestion. It is also a cheap in comparison to scanning file content of rpms and guessing based on that. What do you think? <package name="pcp-pmda-redis" version="6.0.1" release="2.fc36" epoch="0" arch="armv7hl" src="https://download.fedoraproject.org/pub/fedora/linux/updates/36/armv7hl/p/pcp-pmda-redis-6.0.1-2.fc36.armv7hl.rpm"> <filename>pcp-pmda-redis-6.0.1-2.fc36.armv7hl.rpm</filename> <reboot_suggested>True</reboot_suggested> </package> We now have https://github.com/rpm-software-management/dnf5/issues/587 to track this use case in DNF 5, the upcoming package manager that will replace DNF in future versions of RHEL. We'll be thinking about it when we implement the needs-restarting plugin for DNF 5. More advanced logic for "reboot needed" is probably not worth implementing in DNF 4 this late in its life cycle, and the existing logic isn't really something users should rely on, so I have decided to close https://github.com/rpm-software-management/dnf/pull/1906 and leave `base.reboot_needed()` undocumented. Closing this bug. |