Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1105898 - Differenet behaviour with yum RPMs install between 5.9 and 6.5
Differenet behaviour with yum RPMs install between 5.9 and 6.5
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm (Show other bugs)
6.5
x86_64 Linux
unspecified Severity urgent
: rc
: ---
Assigned To: packaging-team-maint
BaseOS QE Security Team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-08 17:02 EDT by Andrejus Chaliapinas
Modified: 2014-06-11 03:36 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-09 03:49:15 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 Andrejus Chaliapinas 2014-06-08 17:02:10 EDT
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 03:41:13 EDT
This change is in rpm, not yum so switching component.
Comment 3 Panu Matilainen 2014-06-09 03:49:15 EDT
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 07:59:46 EDT
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 08:08:54 EDT
%_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 08:58:13 EDT
Could you specify how exactly (in which file) that runtime configuration option needs to be added/enabled?
Comment 7 Andrejus Chaliapinas 2014-06-10 15:17:36 EDT
Could anyone respond with more information here in regards to my comment #6?
Comment 8 Panu Matilainen 2014-06-11 02:49:28 EDT
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.