Bug 1014330 - Ineffective scriptlets for updating rhnplugin.conf
Ineffective scriptlets for updating rhnplugin.conf
Status: CLOSED CANTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: yum-rhn-plugin (Show other bugs)
6.4
All Linux
medium Severity medium
: rc
: ---
Assigned To: Michael Mráka
Red Hat Satellite QA List
:
Depends On:
Blocks: 1023565 1056252
  Show dependency treegraph
 
Reported: 2013-10-01 14:09 EDT by John T. Rose
Modified: 2014-06-09 16:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-09 03:29:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John T. Rose 2013-10-01 14:09:28 EDT
Description of problem:

The SPEC file tags rhnplugin.conf as noreplace but there are pre and post install scriptlets that seem to be attempting to update this file during upgrades. As far as I can tell these scriptlets just create and remove a file in /var/tmp.

preinstall scriptlet (using /bin/sh):
# 682820 - re-enable yum-rhn-plugin after package upgrade if the system is already registered
export pluginconf='/etc/yum/pluginconf.d/rhnplugin.conf'
if [ $1 -gt 1 ] && [ -f /etc/sysconfig/rhn/systemid ] && [ -f "$pluginconf" ]; then
    if grep -q '^[[:space:]]*enabled[[:space:]]*=[[:space:]]*1[[:space:]]*$' \
       "$pluginconf"; then
        touch /var/tmp/enable-yum-rhn-plugin
    fi
fi

postinstall scriptlet (using /bin/sh):
# 682820 - re-enable yum-rhn-plugin after package upgrade if the system is already registered
export pluginconf='/etc/yum/pluginconf.d/rhnplugin.conf'
if [ $1 -gt 1 ] && [ -f "$pluginconf" ] && [ -f "/var/tmp/enable-yum-rhn-plugin" ]; then
    sed -i '/\[main]/,/^$/{/enabled/s/0/1/}' "$pluginconf"
    rm -f /var/tmp/enable-yum-rhn-plugin
fi

This has the effect of leaving the new rhnplugin.conf file in rhnplugin.conf.rpmnew with RHN disabled in it. Doesn't seem to be ideal.

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

yum-rhn-plugin-0.9.1-49.el6.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

rhnplugin.conf is never updated

Expected results:

Would be nice to have this file updated when it hasn't been changed by the user (in this case registration is changing it but that really shouldn't prevent further updates)

Additional info:
Comment 2 RHEL Product and Program Management 2013-10-13 21:50:05 EDT
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 3 John T. Rose 2013-10-15 10:38:55 EDT
So, while I can open a support case for this that seems a rather silly waste of my time. My only goal reporting it here was to help you make your product better.

Why is Comment 1 hidden? Any reason I shouldn't be able to see whatever discussion there was for this bug report? It doesn't seem overly sensitive on the surface.

If it should be fixed and can't be in 6.4 or in 6.5 then why not just work it into whatever schedule works on your end without me needing to open another copy of this report in yet another tracking system?
Comment 4 Clifford Perry 2014-02-03 09:45:08 EST
(In reply to John T. Rose from comment #3)
> So, while I can open a support case for this that seems a rather silly waste
> of my time. My only goal reporting it here was to help you make your product
> better.
> 
> Why is Comment 1 hidden? Any reason I shouldn't be able to see whatever
> discussion there was for this bug report? It doesn't seem overly sensitive
> on the surface.
> 
> If it should be fixed and can't be in 6.4 or in 6.5 then why not just work
> it into whatever schedule works on your end without me needing to open
> another copy of this report in yet another tracking system?


John, it is an automated script used for parsing the large quantity of RHEL bugs. Comment #1 was again an automated, private comment, so employees knew it set the proposed flags for a specific release cycle. 

I'll consider this for RHEL 6.6 cycles.  

Regards,
Cliff
Comment 6 Michael Mráka 2014-06-09 03:29:12 EDT
> Would be nice to have this file updated when it hasn't been changed by the
> user (in this case registration is changing it but that really shouldn't
> prevent further updates)

Unfortunately the the fact that config file has been updated by registration matters. So when updating rpm package this change is detected and leads to creation of rpmnew. There's no way to prevent this. Pre/post install scripts has no effect on this behaviour.
Comment 7 John T. Rose 2014-06-09 16:37:28 EDT
There are two ways to fix this IMO.

(1) Remove the useless scriptlets entirely.

(2) Change the postinstall scriptlet to modify rhnplugin.conf.rpmnew instead so that it is in sync with the state of the running system (i.e., has RHN enabled).

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