Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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.
Description of problem:
I think this is the regression of Bug #1371585.
%postun will be triggered on upgrade and cause the rhsm.conf to restore back to default.
...
%postun
test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf <========= move the backup rhsm.conf back
...
# rpm -Uvh katello-ca-consumer-lonlx80022.nomura.com-1.0-8.noarch.rpm
Preparing... ################################# [100%]
Updating / installing...
1:katello-ca-consumer-lonlx80022.no################################# [ 50%]
Cleaning up / removing...
2:katello-ca-consumer-lonlx80022.no################################# [100%] <=========== %postun will be triggered here
% egrep -i 'host|server' /etc/rhsm/rhsm.conf | egrep -v '^#'
[server]
hostname = subscription.rhsm.redhat.com
This is the updated postun scriptlet I proposed in my support case w/RH to get this fixed -- essentially it's only reverting if it's an actual removal and not during an upgrade situation:
```
%postun
if [ $1 -eq 0 ]; then
test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf
fi
```
I didn't try to rebuild myself so I haven't verified this to work, but it seems like it should.
If you want to avoid re-building the package you could try setting the file immutable or better yet setup a yum post-transaction action to run /usr/bin/katello-rhsm-consumer to reconfigure the file whenever that package is updated.
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/RHSA-2020:1454