Bug 1687116 - kernel version checks should not use /lib/modules to determine running version
Summary: kernel version checks should not use /lib/modules to determine running version
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-tracer
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.8.0
Assignee: Jonathon Turel
QA Contact: Ondrej Gajdusek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-10 01:44 UTC by prasun.gera
Modified: 2020-10-27 12:58 UTC (History)
3 users (show)

Fixed In Version: tracer-0.7.3-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 12:58:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 12:58:34 UTC

Description prasun.gera 2019-03-10 01:44:45 UTC
Description of problem:
I've you have ever installed a newer kernel version than the distro's kernel, it may have modules under /lib/modules. Satellite's web-ui will complain about running an older kernel forever with a "reboot required message" even if you switch back to the latest distro kernel. Even if you uninstall the newer kernels, but their /lib/modules files are present, it will continue to complain. The message is entirely useless as well with no indication about version numbers and such. The way I debugged this was by running katello-tracer-upload with strace, and saw that it was looking under /lib/modules. Once I removed the files from the newer versions, the red cross became green.


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


How reproducible:
Always

Steps to Reproduce:
1. Install a newer kernel. Optionally uninstall it, but leave the files under /lib/modules intact
2. Switch to distro's latest kernel

Actual results:
Red cross

Expected results:
Green tick

Additional info:

Comment 3 Jonathon Turel 2020-03-31 21:38:34 UTC
Hey Prasun,

In your case is kernel-debug installed? I've addressed a BZ recently that was related to having a newer kernel-debug installed than the running kernel which gave a false positive[1] of needing a restart.

One thing I am not clear on is: if I uninstall some version of the kernel then it should not leave files behind in /lib/modules as far as I know. If that's not true can you tell me how I can observe that? On my system, removing the kernel removes the files in /lib/modules

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1709842

Comment 4 prasun.gera 2020-04-01 01:09:22 UTC
Hi Jonathon,
I don't have kernel-debug installed. I use mainline kernels from https://elrepo.org/tiki/kernel-ml. Even after uninstalling the kernel, I see directories left behind with the following files:

For example: 
cd /lib/modules/5.5.6-1.el7.elrepo.x86_64
ls
modules.alias  modules.alias.bin  modules.builtin.bin  modules.dep  modules.dep.bin  modules.devname  modules.softdep  modules.symbols  modules.symbols.bin

The installed kernels have many more files and actual modules. I don't know the reasoning, but it would appear that the rpm cleanup script on elrepo's kernels does not delete everything.

Comment 5 prasun.gera 2020-04-01 01:12:37 UTC
I don't have kernel-debug, but I have kernel-devel. This is the output on my current system:

rpm -qa | grep kernel

kernel-devel-3.10.0-1062.12.1.el7.x86_64
kernel-3.10.0-1062.18.1.el7.x86_64
kernel-ml-devel-5.5.13-1.el7.elrepo.x86_64
kernel-ml-5.6.0-1.el7.elrepo.x86_64
kernel-ml-devel-5.6.0-1.el7.elrepo.x86_64
kernel-ml-devel-5.5.11-1.el7.elrepo.x86_64
kernel-ml-5.5.13-1.el7.elrepo.x86_64
kernel-3.10.0-1062.9.1.el7.x86_64
kernel-devel-3.10.0-1062.18.1.el7.x86_64
kernel-ml-tools-5.6.0-1.el7.elrepo.x86_64
abrt-addon-kerneloops-2.1.11-55.el7.x86_64
kernel-ml-headers-5.6.0-1.el7.elrepo.x86_64
kernel-ml-5.5.11-1.el7.elrepo.x86_64
kernel-devel-3.10.0-1062.9.1.el7.x86_64
kernel-ml-tools-libs-5.6.0-1.el7.elrepo.x86_64
kernel-3.10.0-1062.12.1.el7.x86_64

Comment 6 Jonathon Turel 2020-04-02 19:17:10 UTC
Thanks Prasun - that'll help me narrow down the fix!

Comment 7 Bryan Kearney 2020-05-01 14:22:47 UTC
The Satellite Team is attempting to provide an accurate backlog of bugzilla requests which we feel will be resolved in the next few releases. We do not believe this bugzilla will meet that criteria, and have plans to close it out in 1 month. This is not a reflection on the validity of the request, but a reflection of the many priorities for the product. If you have any concerns about this, feel free to contact Red Hat Technical Support or your account team. If we do not hear from you, we will close this bug out. Thank you.

Comment 9 Ondrej Gajdusek 2020-08-21 14:53:54 UTC
Tracer in the tested version does not check /lib/modules dir anymore. The following verification focuses on newer kernel detection.

$ rpm -qa | grep tracer
tracer-common-0.7.3-1.el7sat.noarch
katello-host-tools-tracer-3.5.4-1.el7sat.noarch
python2-tracer-0.7.3-1.el7sat.noarch

$ yum update kernel

... output omitted ...

                                                                                                                                                                                                   
$ rpm -q kernel
kernel-3.10.0-1062.el7.x86_64
kernel-3.10.0-1127.18.2.el7.x86_64

$ uname -r
3.10.0-1062.el7.x86_64

$ tracer --user=* -av
You should restart:
  * These applications rebooting your computer:
      kernel

$ rpm -q tracer
package tracer is not installed

$ reboot 
.
.
.
(after reboot)

$ uname -r
3.10.0-1127.18.2.el7.x86_64

$ tracer --user=* -av
(shows no output)

Traces report in Satellite matches with the tracer's output.

Comment 12 errata-xmlrpc 2020-10-27 12:58:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4366


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