Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2136224

Summary: [RHEL 8] Messages in posttrans scriptlet do not use the same level
Product: Red Hat Enterprise Linux 8 Reporter: INVADE International Ltd. <third.line>
Component: microcode_ctlAssignee: Eugene Syromiatnikov <esyr>
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.6CC: ajb, toracat
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: microcode_ctl-20220809-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2136506 (view as bug list) Environment:
Last Closed: 2023-05-16 09:11:49 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:
Bug Depends On:    
Bug Blocks: 2136506    

Description INVADE International Ltd. 2022-10-19 16:13:27 UTC
Description of problem:

The microcode_ctl posttrans scriptlet script contains the following:

    if [ -n "${skipped}" ]; then
        skip_msg="After installation of a new version of microcode_ctl package,
initramfs hasn't been re-generated for all the installed kernel packages.
The following kernel packages have been skipped:${skipped}.
Please re-generate initramfs manually for these kernel packages with the
\"dracut -f --kver KERNEL_VERSION\" command in order to get the latest
Intel CPU microcode included into early initramfs image for it, if needed."

        if [ -e /usr/bin/logger ]; then
            echo "${skip_msg}" |
                /usr/bin/logger -p syslog.notice -t microcode_ctl
        fi

        if [ -e /dev/kmsg ]; then
            echo "${skip_msg}" > /dev/kmsg
        fi
    fi

The "logger" message is set to "notice" but the "/dev/kmsg" message uses the default kernel log priority, which is "warning".

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

microcode_ctl-20220207-1.20220510.1.el8_6.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Install a new kernel.

Actual results:

kmsg message is logged as "warning".


Expected results:

kmsg message is logged as "notice".

Additional info:

I believe the "echo" line should read:

            echo "<5>${skip_msg}" > /dev/kmsg

to ensure the messages are logged at the same level.

Initially raised in https://bugs.rockylinux.org/view.php?id=562.

Comment 1 Eugene Syromiatnikov 2022-10-20 13:33:21 UTC
Makes sense, I'd rather change the syslog level to warning, though.

Comment 11 Jeff Bastian 2023-02-20 20:40:52 UTC
Verified with microcode_ctl-20220809-2.el8.  The messages are now logged with level "warning".

[root@dell-per720-05 ~]# rpm -q kernel microcode_ctl | sort
kernel-4.18.0-457.el8.x86_64
kernel-4.18.0-458.el8.x86_64
microcode_ctl-20220809-1.el8.x86_64

[root@dell-per720-05 ~]# rpm -q --scripts microcode_ctl
...
	if [ -n "${skipped}" ]; then
		skip_msg="After installation of a new version of microcode_ctl package,
initramfs hasn't been re-generated for all the installed kernel packages.
The following kernel packages have been skipped:${skipped}.
Please re-generate initramfs manually for these kernel packages with the
\"dracut -f --kver KERNEL_VERSION\" command in order to get the latest
Intel CPU microcode included into early initramfs image for it, if needed."

		if [ -e /usr/bin/logger ]; then
			echo "${skip_msg}" |
				/usr/bin/logger -p syslog.notice -t microcode_ctl
		fi

		if [ -e /dev/kmsg ]; then
			echo "${skip_msg}" > /dev/kmsg
		fi
	fi
...

[root@dell-per720-05 ~]# yum update microcode_ctl
...
Upgraded:
  microcode_ctl-4:20220809-2.el8.x86_64                                         

Complete!

[root@dell-per720-05 ~]# rpm -q microcode_ctl
microcode_ctl-20220809-2.el8.x86_64

[root@dell-per720-05 ~]# rpm -q --scripts microcode_ctl
...
	if [ -n "${skipped}" ]; then
		skip_msg="<4>After installation of a new version of microcode_ctl package,
initramfs hasn't been re-generated for all the installed kernel packages.
The following kernel packages have been skipped:${skipped}.
Please re-generate initramfs manually for these kernel packages with the
\"dracut -f --kver KERNEL_VERSION\" command in order to get the latest
Intel CPU microcode included into early initramfs image for it, if needed."

		if [ -e /usr/bin/logger ]; then
			echo "${skip_msg}" |
				/usr/bin/logger -p syslog.warning -t microcode_ctl
		fi

		if [ -e /dev/kmsg ]; then
			echo "${skip_msg}" > /dev/kmsg
		fi
	fi
...

[root@dell-per720-05 ~]# journalctl -b -p warning --no-hostname --output short-monotonic --no-pager
...
[  603.474237] microcode_ctl[21655]: <4>After installation of a new version of microcode_ctl package,
[  603.475198] microcode_ctl[21655]: initramfs hasn't been re-generated for all the installed kernel packages.
[  603.475319] microcode_ctl[21655]: The following kernel packages have been skipped: kernel-core-4.18.0-458.el8.x86_64.
[  603.475424] microcode_ctl[21655]: Please re-generate initramfs manually for these kernel packages with the
[  603.475527] microcode_ctl[21655]: "dracut -f --kver KERNEL_VERSION" command in order to get the latest
[  603.475648] microcode_ctl[21655]: Intel CPU microcode included into early initramfs image for it, if needed.
[  603.708988] unknown: After installation of a new version of microcode_ctl package,
[  603.716620] unknown: initramfs hasn't been re-generated for all the installed kernel packages.
[  603.725387] unknown: The following kernel packages have been skipped: kernel-core-4.18.0-458.el8.x86_64.
[  603.735116] unknown: Please re-generate initramfs manually for these kernel packages with the
[  603.743780] unknown: "dracut -f --kver KERNEL_VERSION" command in order to get the latest
[  603.752057] unknown: Intel CPU microcode included into early initramfs image for it, if needed.

Comment 14 errata-xmlrpc 2023-05-16 09:11:49 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 (microcode_ctl bug fix and enhancement update), 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/RHBA-2023:3046