RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 1105898 - Differenet behaviour with yum RPMs install between 5.9 and 6.5
Summary: Differenet behaviour with yum RPMs install between 5.9 and 6.5
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm
Version: 6.5
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-08 21:02 UTC by Andrejus Chaliapinas
Modified: 2014-06-11 07:36 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-09 07:49:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andrejus Chaliapinas 2014-06-08 21:02:10 UTC
Description of problem:
In RHEL 6.5 when using yum to install RPM, which in it's post section exits with 1 - yum itself returns 0. In RHEL 5.9 in such case yum returned 1.

Version-Release number of selected component (if applicable):
For 5.9 use case it worked as expected with yum 3.2.22
For 6.5 use case it does work same way with yum 3.2.29


How reproducible:


Steps to Reproduce:
1. Prepare simple RPM and call it TestRPM, which would have such in it's RPM spec post section:

#-------------------------------------------------------------------------------------------------------------
#The post macro is for running anything after the install
#-------------------------------------------------------------------------------------------------------------
%post
echo "Exiting with 1"
exit 1

2. Prepare bash testyum.sh script with such in it:
yum -y install /home/scdevops/TestRPM.x86_64.rpm
RC=$?
echo "result code: $RC"

3. Run testyum.sh on both RHEL 5.9 and 6.4

4. Observe that on 5.9 output will have such part:
...
Exiting with 1
warning: %post(TestRPM-1.0-20140529.x86_64) scriptlet failed, exit status 1
  Verifying  : TestRPM-1.0-20140529.x86_64                                                                                                                  1/1

Installed:
  TestRPM.x86_64 0:1.0-20140529

Complete!
result code: 1

i.e. result code here as expected 1

5. Observe that on 6.5 output will have such part:
...
Exiting with 1
warning: %post(TestRPM-1.0-20140529.x86_64) scriptlet failed, exit status 1
  Verifying  : TestRPM-1.0-20140529.x86_64                                                                                                                  1/1

Installed:
  TestRPM.x86_64 0:1.0-20140529

Complete!
result code: 0

i.e. result code here unexpected to be 0




Actual results:


Expected results:

Expected to behave the same way on both RHEL 5.9 and RHEL 6.5


Additional info:

Comment 2 Panu Matilainen 2014-06-09 07:41:13 UTC
This change is in rpm, not yum so switching component.

Comment 3 Panu Matilainen 2014-06-09 07:49:15 UTC
This is an intentional change in rpm >= 4.6.x, but one that hasn't perhaps been adequately communicated in RHEL 6 context. For that reason, a compatibility mode has been introduced in this RHEL-6 errata to give users more time to adapt to the new behavior:

https://rhn.redhat.com/errata/RHBA-2013-1665.html

Note that use of this compat mode is actually not recommended, and that this option is RHEL-6 only, RHEL-7 will not have it as it is only provided as a temporary migration aid.

Comment 4 Andrejus Chaliapinas 2014-06-09 11:59:46 UTC
Hi Panu,

I need additional explanation of that introduced compatibility mode. Errata says:

With this update, Red Hat Enterprise Linux 5 backwards-compatibility option,
"%_strict_script_errors macro", has been added. The default behavior of Red Hat
Enterprise Linux 6 does not change with this update and users that do not demand
this option specifically are not advised to use it.

Does it mean that usage/addition of "%_strict_script_errors macro" into RPM spec will make it behave in a way it was on RHEL 5.9? I.e. exit code 1 will be properly propagated through yum and into shell?

If not adding this macro - what is alternative to indicate from inside RPM spec that some step has failed and exit with return code of 1?

Not that clear from such documentation

Comment 5 Panu Matilainen 2014-06-09 12:08:54 UTC
%_strict_script_errors is a runtime configuration option that needs to be enabled on the systems where the former scriptlet error behavior is wanted, it does not affect builds in any way.

Comment 6 Andrejus Chaliapinas 2014-06-09 12:58:13 UTC
Could you specify how exactly (in which file) that runtime configuration option needs to be added/enabled?

Comment 7 Andrejus Chaliapinas 2014-06-10 19:17:36 UTC
Could anyone respond with more information here in regards to my comment #6?

Comment 8 Panu Matilainen 2014-06-11 06:49:28 UTC
Its a macro, set to non-zero to enable in a macro configuration file.
Or better yet, dont - as the notes say its use is discouraged unless you really know what you're doing.

Further enquiries to the appropriate RHEL support forums please, this is a bug tracker only.


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