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.
Bug 1770366 - [RFE] Improve upgrade efficiency by moving RPM post-installation scripts to the installer.
Summary: [RFE] Improve upgrade efficiency by moving RPM post-installation scripts to t...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Packaging
Version: 6.6.0
Hardware: All
OS: All
unspecified
medium
Target Milestone: 6.8.0
Assignee: Eric Helms
QA Contact: Lukas Pramuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-08 19:56 UTC by Dylan Gross
Modified: 2023-12-15 16:55 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 12:59:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 4565871 0 None None None 2019-11-08 20:16:10 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 12:59:38 UTC

Description Dylan Gross 2019-11-08 19:56:55 UTC
1. Proposed title of this feature request

   Improve Satellite upgrade efficiency by moving RPM post-installation scripts to the installer.

3. What is the nature and description of the request?

   At present, there at least nine RPMs that perform the same post-installation actions.  During a Satellite upgrade, the process would therefore repeat at least nine times the following actions....

~~~
    /usr/sbin/foreman-rake db:migrate >> /var/log/foreman/db_migrate.log 2>&1 || :
    /usr/sbin/foreman-rake db:seed >> /var/log/foreman/db_seed.log 2>&1 || :
    /usr/sbin/foreman-rake apipie:cache:index >> /var/log/foreman/apipie_cache.log 2>&1 || :
    (touch /usr/share/foreman/tmp/restart.txt ; /bin/systemctl try-restart foreman.service) >/dev/null 2>&1
    exit 0
~~~

   This can extend the time it takes to do an upgrade (and thus increase the length of an outage).

4. Why does the customer need this? (List the business requirements here)

   To minimize downtime due to upgrades.

5. How would the customer like to achieve this? (List the functional requirements here)

    Those three foreman-rake calls are executed as RPM post-install scripts when the RPMs are updated.  They could potentially be executed only once by the installer after installation instead of once for each RPM.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

   Verify that the installer is executing those actions after one of those RPMs is updated.

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

   I have not found an existing RFE upstream or in Red Hat Bugzilla, but this appears to have been an active discussion here:   https://community.theforeman.org/t/database-and-service-actions-in-rpm-post-scripts/7311/13

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

   No

9. Is the sales team involved in this request and do they have any additional input?

   No

10. List any affected packages or components.

  The following RPMs were identified as making these (or very similar calls).  However, there may be more optionally-installed ones that haven't been found yet.

    foreman-1.22.0.32-1.el7sat.noarch
    tfm-rubygem-foreman-tasks-0.15.11.1-1.el7sat
    tfm-rubygem-foreman_bootdisk-15.0.0-1.el7sat
    tfm-rubygem-foreman_discovery-15.0.2-1.el7sat
    tfm-rubygem-foreman_openscap-1.0.8-1.el7sat
    tfm-rubygem-foreman_remote_execution-1.8.0.4-1.el7sat
    tfm-rubygem-redhat_access-2.2.8-1.el7sat
    tfm-rubygem-foreman_templates-6.0.3-2.el7sat
    tfm-rubygem-foreman_ansible-3.0.7.1-1.el7sat

11. Would the customer be able to assist in testing this functionality if implemented?

    Yes.

Comment 5 Lukas Pramuk 2020-08-31 14:11:55 UTC
FailedQA.

@Satellite 6.8.0 Snap12
tfm-rubygem-redhat_access-2.2.13-1.el7sat.noarch

# for p in foreman tfm-rubygem-foreman-tasks tfm-rubygem-foreman_bootdisk tfm-rubygem-foreman_discovery tfm-rubygem-foreman_openscap tfm-rubygem-foreman_remote_execution tfm-rubygem-redhat_access tfm-rubygem-foreman_templates tfm-rubygem-foreman_ansible; do echo === $p ================= ; rpm -q --scripts $p | grep foreman-rake ; done 

=== foreman =================
  /usr/sbin/foreman-rake security:generate_token >/dev/null 2>&1 || :
  /usr/sbin/foreman-rake security:generate_encryption_key >/dev/null 2>&1 || :
=== tfm-rubygem-foreman-tasks =================
=== tfm-rubygem-foreman_bootdisk =================
=== tfm-rubygem-foreman_discovery =================
=== tfm-rubygem-foreman_openscap =================
=== tfm-rubygem-foreman_remote_execution =================
=== tfm-rubygem-redhat_access =================
/usr/sbin/foreman-rake db:migrate >> /var/log/foreman/db_migrate.log 2>&1 || :
/usr/sbin/foreman-rake db:seed >> /var/log/foreman/db_seed.log 2>&1 || :
/usr/sbin/foreman-rake apipie:cache:index >> /var/log/foreman/apipie_cache.log 2>&1 || :
=== tfm-rubygem-foreman_templates =================
=== tfm-rubygem-foreman_ansible =================


>>> yet tfm-rubygem-redhat_access rpm postscript contains db:migrate, db:seed and apipie:cache:index tasks

Comment 6 Lukas Pramuk 2020-09-07 15:49:17 UTC
This shouldn't be ON_QA as satellite6/satellite-packaging/merge_requests/4440 is still open

Comment 7 Lukas Pramuk 2020-09-21 15:53:40 UTC
VERIFIED.

@Satellite 6.8.0 Snap16
foreman-2.1.2.12-1.el7sat.noarch
tfm-rubygem-foreman-tasks-2.0.2-1.fm2_1.el7sat.noarch
tfm-rubygem-foreman_bootdisk-17.0.2-2.fm2_1.el7sat.noarch
tfm-rubygem-foreman_discovery-16.1.0-1.el7sat.noarch
tfm-rubygem-foreman_openscap-4.0.3-1.fm2_1.el7sat.noarch
tfm-rubygem-foreman_remote_execution-3.3.7-1.el7sat.noarch
tfm-rubygem-redhat_access-2.2.17-1.fm2_1.el7sat.noarch
tfm-rubygem-foreman_templates-9.0.1-1.fm2_1.el7sat.noarch
tfm-rubygem-foreman_ansible-5.1.3-1.el7sat.noarch

# for p in foreman tfm-rubygem-foreman-tasks tfm-rubygem-foreman_bootdisk tfm-rubygem-foreman_discovery tfm-rubygem-foreman_openscap tfm-rubygem-foreman_remote_execution tfm-rubygem-redhat_access tfm-rubygem-foreman_templates tfm-rubygem-foreman_ansible; do echo === $p ================= ; rpm -q --scripts $p | grep foreman-rake ; done 

=== foreman =================
  /usr/sbin/foreman-rake security:generate_token >/dev/null 2>&1 || :
  /usr/sbin/foreman-rake security:generate_encryption_key >/dev/null 2>&1 || :
=== tfm-rubygem-foreman-tasks =================
=== tfm-rubygem-foreman_bootdisk =================
=== tfm-rubygem-foreman_discovery =================
=== tfm-rubygem-foreman_openscap =================
=== tfm-rubygem-foreman_remote_execution =================
=== tfm-rubygem-redhat_access =================
=== tfm-rubygem-foreman_templates =================
=== tfm-rubygem-foreman_ansible =================


>>> these rpms postscripts no longer contain db:migrate, db:seed and apipie:cache:index tasks (speeding up rpm installation/update)

Comment 10 errata-xmlrpc 2020-10-27 12:59:24 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 (Important: Satellite 6.8 release), 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:4366


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