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 2136506

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

Description Eugene Syromiatnikov 2022-10-20 13:37:05 UTC
+++ This bug was initially created as a clone of Bug #2136224 +++

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.

--- Additional comment from Eugene Syromiatnikov on 2022-10-20 13:33:21 UTC ---

Makes sense, I'd rather change the syslog level to warning, though.

Comment 12 Jeff Bastian 2023-02-20 23:00:10 UTC
Verified with microcode_ctl-20220809-1.el9.  The messages are now logged with level "warning".

[root@dell-per720-05 ~]# rpm -q kernel microcode_ctl | sort
kernel-5.14.0-268.el9.x86_64
kernel-5.14.0-278.el9.x86_64
microcode_ctl-20220809-1.el9.noarch

[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
}

exit 0

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

Complete!

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

[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
...
[ 2442.139255] microcode_ctl[17945]: <4>After installation of a new version of microcode_ctl package,
[ 2442.140098] microcode_ctl[17945]: initramfs hasn't been re-generated for all the installed kernel packages.
[ 2442.140222] microcode_ctl[17945]: The following kernel packages have been skipped: kernel-core-5.14.0-268.el9.x86_64.
[ 2442.140308] microcode_ctl[17945]: Please re-generate initramfs manually for these kernel packages with the
[ 2442.140368] microcode_ctl[17945]: "dracut -f --kver KERNEL_VERSION" command in order to get the latest
[ 2442.140424] microcode_ctl[17945]: Intel CPU microcode included into early initramfs image for it, if needed.
[ 2443.328370] unknown: After installation of a new version of microcode_ctl package,
[ 2443.335981] unknown: initramfs hasn't been re-generated for all the installed kernel packages.
[ 2443.344746] unknown: The following kernel packages have been skipped: kernel-core-5.14.0-268.el9.x86_64.
[ 2443.354502] unknown: Please re-generate initramfs manually for these kernel packages with the
[ 2443.363186] unknown: "dracut -f --kver KERNEL_VERSION" command in order to get the latest
[ 2443.371466] unknown: Intel CPU microcode included into early initramfs image for it, if needed.
[ 2442.583376] systemd[1]: /usr/lib/systemd/system/insights-client-boot.service:24: Unit uses MemoryLimit=; please use MemoryMax= instead. Support for MemoryLimit= will be removed soon.

Comment 15 errata-xmlrpc 2023-05-09 08:25:19 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:2569