RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2043538 - yum needs_restarting reports wrong result after some time sfter update of critical packages
Summary: yum needs_restarting reports wrong result after some time sfter update of cri...
Keywords:
Status: CLOSED DUPLICATE of bug 2022389
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf-plugins-core
Version: 8.3
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nicola Sella
QA Contact: swm-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-21 13:33 UTC by Dmitry
Modified: 2022-03-15 14:32 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-15 14:32:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-109108 0 None None None 2022-01-21 13:43:14 UTC

Description Dmitry 2022-01-21 13:33:12 UTC
Description of problem:
yum needs-restaring -r  returns 1 immediately and for some time after installation of critical packages, but after some time starts return 0

Reason is:
Script
/usr/lib/python3.6/site-packages/dnf-plugins/needs_restarting.py
compares package installtime with os boottime, and boottime assumed as:  

    def get_boot_time():
        return int(os.stat('/proc/1/cmdline').st_mtime)

but timestamp of st_mtime, seems updates from time to time.
For example on host, affected by problem: 

# stat /proc/1/cmdline
  File: /proc/1/cmdline
  Size: 0               Blocks: 0          IO Block: 1024   regular empty file
Device: 5h/5d   Inode: 40351045    Links: 1
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:system_r:init_t:s0
Access: 2022-01-21 14:22:43.161122475 +0300
Modify: 2022-01-21 14:22:43.161122475 +0300
Change: 2022-01-21 14:22:43.161122475 +0300
 Birth: -
# uptime
 16:29:39 up 127 days,  5:10,  2 users,  load average: 0.15, 0.08, 0.06

Comment 1 Nicola Sella 2022-01-25 18:25:04 UTC
A patch to mitigate the issue was released on z-stream for 8.5 and y-stream

https://bugzilla.redhat.com/show_bug.cgi?id=2022389

Comment 2 Nicola Sella 2022-01-27 12:18:36 UTC
May I ask for more information on the system? Also, what version of dnf and plugins are you running?

Comment 3 Dmitry 2022-02-02 10:04:26 UTC
# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.3 (Ootpa)

# rpm -qa | grep dnf
dnf-data-4.7.0-4.el8.noarch
dnf-plugins-core-4.0.21-3.el8.noarch
python3-libdnf-0.63.0-3.el8.x86_64
python3-dnf-4.7.0-4.el8.noarch
python3-dnf-plugins-core-4.0.21-3.el8.noarch
libdnf-0.63.0-3.el8.x86_64
dnf-plugin-subscription-manager-1.27.18-1.el8_3.x86_64
dnf-4.7.0-4.el8.noarch

Comment 4 Nicola Sella 2022-02-09 09:23:13 UTC
Thank you for being specific on the versions. From what I see, there is some mismatch between your RHEL version and dnf/dnf-plugins-core version.
dnf-4.7.0 and dnf-plugins-core-4.0.21 were released on 8.5, and I see that you have 8.3.

Did you update redhat-release package?
From which repository did you download dnf

Comment 5 Dmitry 2022-02-10 06:41:15 UTC
System is updated from standard redhat repository, but only security updates are installed.
For that reason redhat-release package is not updated.

Comment 6 Nicola Sella 2022-03-07 16:28:09 UTC
As I understand it, redhat-release shows a wrong version of rhel because it is not updated 
and dnf is not installed on 8.3 in the version you provided.
I believe this is related to rhel > 8.4 for which, we have addressed the issue from comment1.


Note You need to log in before you can comment on or make changes to this bug.