Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1960437

Summary: needs-restarting calculating wrong boot time
Product: [Fedora] Fedora Reporter: David L. Crow <crow>
Component: dnf-plugins-coreAssignee: nsella
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 34CC: alex.j.kerzner, dmach, jmracek, mblaha, packaging-team-maint, pkratoch, praiskup, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 David L. Crow 2021-05-13 20:44:37 UTC
Description of problem:

needs-restarting -r is calculating the wrong boot time, so it is not correctly detecting a need to restart.  I think this is a regression caused by the changes introduced in bug 1914251.


Version-Release number of selected component (if applicable): python3-dnf-plugins-core-4.0.19-1.fc34.noarch


How reproducible: every time


Steps to Reproduce:

These are steps that I ran just now after a new kernel was installed at 6:30a this morning.

# needs-restarting -r
No core libraries or services have been updated since boot-up.
Reboot should not be necessary.
# uptime
 15:35:25 up 8 days,  6:51,  2 users,  load average: 0.07, 0.07, 0.08
# ls -la /proc/1/cmdline
-r--r--r-- 1 root root 0 May 13 06:59 /proc/1/cmdline
# cat /proc/stat | grep btime
btime 1620222248
# uname -r
5.11.17-300.fc34.x86_64
# rpm -q kernel
kernel-5.11.17-300.fc34.x86_64
kernel-5.11.19-300.fc34.x86_64

Actual results:

Does not indicate that a restart is necessary.

Expected results:

Should indicate that a restart is necessary.

If I reverse apply the patch in bug 1914251 so that the boot time is calculated correctly, I receive the following output:

Core libraries or services have been updated since boot-up:
  * glibc
  * kernel
  * systemd


Additional info: