Bug 2042313

Summary: needs-restarting could check boot time with /proc/uptime not with /proc/stat
Product: Red Hat Enterprise Linux 7 Reporter: alex
Component: yum-utilsAssignee: Nicola Sella <nsella>
Status: CLOSED CURRENTRELEASE QA Contact: swm-qe
Severity: low Docs Contact: Mariya Pershina <mpershin>
Priority: unspecified    
Version: 7.9CC: lkuprova, mpershin, nsella, packaging-team-maint
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
.The `needs-restarting` command from `yum-utils` might fail to display the container boot time In certain RHEL 7 container environments, the `needs-restarting` command from the `yum-utils` package might incorrectly display the host boot time instead of the container boot time. As a consequence, this command might still report a false reboot warning message after you restart the container environment. You can safely ignore this harmless warning message in such a case.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-01-27 07:24:19 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:

Description alex 2022-01-19 08:48:37 UTC
Description of problem:

needs-restarting checks /proc/stat for boot time. In some container environments (I'm using LXC on Proxmox), this shows the host boot time, not the container time.

uptime gets the correct boot time by using /proc/uptime.

Although maybe this would be a bug in the container environment, I believe it would be simpler if needs-restarting behaved consistently with the uptime command.

Given the age of EL7, though, I understand this is probably not going to change- I'm mostly filing this bug to document this issue.

Version-Release number of selected component (if applicable):

procps-ng-3.3.10-28.el7.x86_64

How reproducible:

Installing openssl updates makes needs-restart show a reboot message that doesn't go away if you reboot.

Steps to Reproduce:
1. Install openssl updates on an LXC host
2. Check that needs-restarting suggests a reboot
3. Reboot the container
4. Check that needs-restarting still suggests a boot. Examine /proc/stat and /proc/uptime of both host and container.

Actual results:

A restart doesn't clear the warning.

Expected results:

A restart should clear the warning.

Comment 3 alex 2022-01-19 08:50:32 UTC
If there's a possibility that a patch changing this would be accepted (or some other fix), I could give it a go.

Comment 5 Lenka Špačková 2022-01-26 16:33:33 UTC
Known issue published in the RHEL 7.9 Release notes:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/7.9_release_notes/index#BZ-2042313

Thank you all for your work!

Comment 6 Jaroslav Mracek 2022-01-27 07:24:19 UTC
I am closing the bug because the release note was released.