Bug 1683835
| Summary: | Upgrading from one katello-ca-consumer version to another breaks rhsm.conf | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Gary Scarborough <gscarbor> |
| Component: | Installation | Assignee: | satellite6-bugs <satellite6-bugs> |
| Status: | CLOSED DUPLICATE | QA Contact: | Devendra Singh <desingh> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.4 | CC: | bkearney, chrobert, cmarinea, greartes, mmccune, momran, pdwyer, rjerrido, satellite6-bugs, vcojot |
| Target Milestone: | 6.8.0 | Keywords: | EasyFix, Patch, PrioBumpPM, Triaged, Upgrades, UserExperience |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-01-28 13:35:42 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: | |||
|
Description
Gary Scarborough
2019-02-27 23:20:52 UTC
Looking at the src.rpm's SPEC file that Mathieu uploaded, I think the following section: ======================= CUT HERE ======================= %post /bin/bash /usr/bin/katello-rhsm-consumer %postun test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf ======================= CUT HERE ======================= should be changed to something like this: ======================= CUT HERE ======================= %post if [ "$1" = "1" ]; then # this is an initial install, not an upgrade. /bin/bash /usr/bin/katello-rhsm-consumer fi %postun if [ $1 -eq 0 ]; then # this is an uninstall, not an upgrade. test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf fi ======================= CUT HERE ======================= I did rebuild both rpms and made two versions with the SPEC file changes. [root@rh7x64 noarch]# rpm -ivh katello-ca-consumer-w0575.example.com-1.0-170.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:katello-ca-consumer-w0575stipsnms################################# [100%] [root@rh7x64 noarch]# grep prefix /etc/rhsm/rhsm.conf # Server prefix: prefix = /rhsm [root@rh7x64 noarch]# rpm -Uvh katello-ca-consumer-w0575.example.com-1.0-180.noarch.rpm Preparing... ################################# [100%] Updating / installing... 1:katello-ca-consumer-w0575stipsnms################################# [ 50%] Cleaning up / removing... 2:katello-ca-consumer-w0575stipsnms################################# [100%] [root@rh7x64 noarch]# grep prefix /etc/rhsm/rhsm.conf # Server prefix: prefix = /rhsm Btw, i am not even sure the %post should be skipped in the case of an upgrade. The %postun makes sense but if the satellite script called in %post (/usr/bin/katello-rhsm-consumer) truly is idempotent then perhaps it shouldn't be skipped when in an upgrade. I've not read /usr/bin/katello-rhsm-consumer so I cannot tell if it will be future-proof and sufficient to skip it (what happens if Satellite gets upgraded from 6.4 to 6.5, does that script need to be re-evaluated?) |