Bug 569930 - rpm exits 0 on scriptles failure
Summary: rpm exits 0 on scriptles failure
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 15
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 963724 1487414
TreeView+ depends on / blocked
 
Reported: 2010-03-02 17:46 UTC by Paolo Penzo
Modified: 2018-11-26 19:09 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 592234 963724 (view as bug list)
Environment:
Last Closed: 2012-08-06 20:04:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
rpm-4.6.0 and rpm 4.6.1 patch (1.16 KB, patch)
2010-03-25 22:53 UTC, Paolo Penzo
no flags Details | Diff
rpm-4.7.1 patch (1.16 KB, patch)
2010-03-25 22:56 UTC, Paolo Penzo
no flags Details | Diff
rpm-4.7.2 patch (1.25 KB, patch)
2010-03-25 22:57 UTC, Paolo Penzo
no flags Details | Diff
A patch for rpm 4.8.1 (1.24 KB, patch)
2010-11-15 16:27 UTC, Paolo Penzo
no flags Details | Diff
rpm-4.9.1 patch (1.13 KB, application/octet-stream)
2011-09-15 15:57 UTC, Paolo Penzo
no flags Details

Description Paolo Penzo 2010-03-02 17:46:55 UTC
As far I've seen, see bugs 533831 and 465409, starting with version 4.6 rpm exits 0 even if the scriptlets (all but %pre and %preun) exit with error.
IMHO this breaks legacy rpm behaviour (i.e. pre version 4.6) and leads to misunderstandings since a simple test on the rpm exit code is not reliable anymore. In other words the rpm exit status tells that the software itself has been replaced (updated) by a newer version but you know nothing about all the others steps involed with a change management process (rebuilding of library cache, configuration migration, service restart an so on).

Is there a way tho revert to the old behaviour or to have them toghether?

How reproducible:
Always, just place exit 1 in you rpm %post scriptlet.

Comment 1 Panu Matilainen 2010-03-03 09:57:08 UTC
The problem is that a simple integer value is nowhere near sufficient for encoding the status of an operation potentially involving thousands of packages. The new exit code simply reflects (like you point out) what rpm knows for sure: whether the software on disk was installed/updated/removed or not.

One possibility could be treating the exit code as a bitfield: one bit for "one or more scriptlets failed" and another for "one or more package failed to install/remove", so you would have at least a hint if everything went smoothly or not, but the warning bit still tells you preciously little about what/where the actual problem was.

Rpm could also add status field to headers upon package install/upgrade, eg "one or more scriptlets failed when installing this package" but that wont help with erasure failures as there's no place to persistently record the failure.

Oh and rpm does issue callbacks on all scriptlet failures so librpm API users can track what happens during the transaction (eg yum collects this information and logs them as warnings/errors).

Comment 2 Paolo Penzo 2010-03-12 16:43:40 UTC
I agree with you, from the point of view of the rpm API a simple integer value might not be sufficient for encoding the status a massive rpm operation.
However, for a batch script, a simple warning message is not sufficient to tell that your software upgrade went wrong due to a failure in the %post scriptlet
leaving you mission critical application stopped due to simple typo in a configuration file...
So I think  rpm (yum behaves the same way) should treat errors in %post script as before or, at least, it should be possible to choose the old or the new approach with a macro or via a command line switch.

Comment 3 Paolo Penzo 2010-03-25 22:53:12 UTC
Created attachment 402709 [details]
rpm-4.6.0 and rpm 4.6.1 patch

A patch to revert to the old behaviour and consider non-pre scriptlet errors as warnings only if the new macro _ignore_post_scripts_errors is set.

This is the rpm 4.6.x patch

Comment 4 Paolo Penzo 2010-03-25 22:56:23 UTC
Created attachment 402711 [details]
rpm-4.7.1 patch

A patch to revert to the old behaviour and consider non-pre scriptlet errors as warnings only if the new macro _ignore_post_scripts_errors is set.

This is the rpm 4.7.1 patch

Comment 5 Paolo Penzo 2010-03-25 22:57:23 UTC
Created attachment 402712 [details]
rpm-4.7.2 patch

A patch to revert to the old behaviour and consider non-pre scriptlet errors as warnings only if the new macro _ignore_post_scripts_errors is set.

Comment 6 Bug Zapper 2010-04-28 11:54:49 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Paolo Penzo 2010-05-07 11:44:28 UTC
Changed release version due to FC11 EOL

Comment 8 Paolo Penzo 2010-05-10 16:03:25 UTC
Fedora 13 (rpm-4.8.0) shows the same behaviour. To revert to the old one, the patch in comment #5 can be applied.

Comment 9 Paolo Penzo 2010-11-15 16:27:10 UTC
Created attachment 460569 [details]
A patch for rpm 4.8.1

This issue is still around in Release 14.

Comment 10 devzero2000 2010-11-16 11:26:47 UTC
Ciao Paolo.

I have also tracked this here https://bugs.launchpad.net/rpm/+bug/675954

Comment 11 Paolo Penzo 2011-09-15 15:57:15 UTC
Created attachment 523397 [details]
rpm-4.9.1 patch

A patch for rpm 4.9.1.1 (FC15)

Comment 13 Krzysztof Daniel 2012-02-15 20:13:43 UTC
Are there any plans to get this fixed?

Comment 14 Krzysztof Daniel 2012-04-02 07:09:42 UTC
This issue is very important for Eclipse package (www.eclipse.org). Eclipse is shipped with a plugin management system/update system which needs to be launched when additional Eclipse plugins are installed via RPM.

Comment 15 Paolo Penzo 2012-04-03 07:30:25 UTC
IMHO it's important in every unattended installation process.
Could you solve with the patches I've provided?

Comment 16 Fedora End Of Life 2012-08-06 20:04:23 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 15. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 15 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 17 Fedora End Of Life 2012-08-06 20:04:23 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 15. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 15 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 18 devzero2000 2012-08-07 16:59:24 UTC
(In reply to comment #15)
> IMHO it's important in every unattended installation process.
> Could you solve with the patches I've provided?

HeHe, Paolo, this is an endless saga, no doubt. I forgot to post here a link to the same issue discussed some time ago on another mailing list http://rpm5.org/community/rpm-users/0834.html. Cheers


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