Description of problem: The post scriptlet in RHUI client config rpms will fail if /etc/yum/pluginconf.d/rhnplugin.conf does not exist as yum-rhn-plugin is not installed, and warning will be printed during installation of the client config rpms such like: sed: can't read /etc/yum/pluginconf.d/rhnplugin.conf: No such file or directory (I'll attach more detailed log in this bz also.) But, RHUI clients should only use RHUI (CDS) repos in most cases and it's not strange that yum-rhn-plugin is not installed because it never be used in such systems, I think. Version-Release number of selected component (if applicable): I confirmed this issue in client config rpms built w/ rh-rhui-tools-2.1.17-1.el6_3.noarch. How reproducible: This should happen always in any RHEL systems in which yum-rhn-plugin is not installed. Steps to Reproduce: 1. Build client config rpms 2. Install it into the systems in which yum-rhn-plugin is not installed Actual results: The warning message will be printed. Expected results: No warnings. Additional info: It's not difficult to fix this problem; the change to /etc/rhui/templates/rh-client-config.spec in rh-rhui-tools like the following should be sufficient, I guess: [root@rhua ~]# diff -u /etc/rhui/templates/rh-client-config.spec.save /etc/rhui/templates/rh-client-config.spec --- /etc/rhui/templates/rh-client-config.spec.save 2013-04-18 10:32:13.323003015 +0900 +++ /etc/rhui/templates/rh-client-config.spec 2013-04-18 10:34:10.238003008 +0900 @@ -55,8 +55,8 @@ %post # Disable RHN plugin -sed -e 's/^enabled.*/enabled = 0/g' /etc/yum/pluginconf.d/rhnplugin.conf > /tmp/rhnplugin.conf -mv /tmp/rhnplugin.conf /etc/yum/pluginconf.d/ +f=/etc/yum/pluginconf.d/rhnplugin.conf +test -f $f && sed -i.rhuisave -e 's/^enabled.*/enabled = 0/g' $f || : %clean [root@rhua ~]#
Created attachment 737104 [details] The console log during installation of RHUI client config RPM This is the console log of RHEL 6.4 x86_64 guest during installation of RHUI client config RPM named rhel-6-config built w/ rh-rhui-tools-2.1.17-1.el6_3.noarch. yum-rhn-plugin is not installed in this guest.
Sorry that I didn't think cases of rhui client config updates carefully. This should be better than previous one: [root@rhua ~]# diff -u /etc/rhui/templates/rh-client-config.spec.save /etc/rhui/templates/rh-client-config.spec --- /etc/rhui/templates/rh-client-config.spec.save 2013-04-18 10:32:13.323003015 +0900 +++ /etc/rhui/templates/rh-client-config.spec 2013-04-18 21:24:35.201003004 +0900 @@ -54,9 +54,11 @@ %post -# Disable RHN plugin -sed -e 's/^enabled.*/enabled = 0/g' /etc/yum/pluginconf.d/rhnplugin.conf > /tmp/rhnplugin.conf -mv /tmp/rhnplugin.conf /etc/yum/pluginconf.d/ +if [ $1 = 1 ]; then # 1: install (http://fedoraproject.org/wiki/Packaging:ScriptletSnippets) + # Disable RHN plugin if yum-rhn-plugin is installed: + f=/etc/yum/pluginconf.d/rhnplugin.conf + test -f $f && sed -i.rhuisave -e 's/^enabled.*/enabled = 0/g' $f || : +fi %clean [root@rhua ~]#
Currently, I can't check if it's applicable to RHUI3 because of BZ1308349
It appears code exists now in the specfile template to handle this case.
This must have been fixed a long time ago, and even in RHUI 2. Anyway, here's how the scriptlet looks now: %post if [ "$1" = "1" ]; then # 'install', not 'upgrade' # Disable RHN plugin if [ -f /etc/yum/pluginconf.d/rhnplugin.conf ]; then grep -iP "enabled = (0|false|off)" /etc/yum/pluginconf.d/rhnplugin.conf || sed -i.save -e 's/^enabled.*/enabled = 0/g' /etc/yum/pluginconf.d/rhnplugin.conf || : fi fi So, as one can expect, the actual tweaking of 'enabled' is only performed if the rhnplugin.conf file exists. In practice: # yum remove yum-rhn-plugin-2.0.1-6.el7.noarch ... Complete! # ls /etc/yum/pluginconf.d/rhnplugin.conf ls: cannot access /etc/yum/pluginconf.d/rhnplugin.conf: No such file or directory # rpm -ivh /tmp/rhui-7-1.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:rhui-7-1 ################################# [100%] # The tweaking is performed if the file exists and the plugin is enabled: # ls /etc/yum/pluginconf.d/rhnplugin.conf /etc/yum/pluginconf.d/rhnplugin.conf # grep ^enabled /etc/yum/pluginconf.d/rhnplugin.conf enabled = 1 # rpm -ihv /tmp/rhui-7-1.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:rhui-7-1 ################################# [100%] # grep ^enabled /etc/yum/pluginconf.d/rhnplugin.conf enabled = 0 # diff /etc/yum/pluginconf.d/rhnplugin.conf{.save,} 2c2 < enabled = 1 --- > enabled = 0 If the plugin is disabled to begin with, 'enabled = 0' is printed after the config RPM is installed, but that's another bug (already filed).
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, 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-2017:0367