Bug 966980 - backup.sh return code always 0 even on error
backup.sh return code always 0 even on error
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
All Linux
high Severity high
: ---
: 3.3.0
Assigned To: Eli Mesika
Lukas Svaty
Depends On:
  Show dependency treegraph
Reported: 2013-05-24 08:51 EDT by Harald Klein
Modified: 2016-02-10 14:29 EST (History)
9 users (show)

See Also:
Fixed In Version: is9
Doc Type: Bug Fix
Doc Text:
--no tech note required
Story Points: ---
Clone Of:
Last Closed: 2014-01-21 12:22:15 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 16440 None None None Never

  None (edit)
Description Harald Klein 2013-05-24 08:51:03 EDT
Description of problem:

backup.sh always returns 0, even when the pg_dump fails

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:
1. /usr/share/ovirt-engine/dbscripts/backup.sh -s localhost -p 5432 -d notexistingdb -u postgres -l /var/lib/ovirt-engine/backups
2. echo $?

Actual results:


Expected results:


Additional info:

the culprit is here:

if [ $? -eq 0 ];then
    echo "Backup of database $DATABASE to $file completed."
    exit 0
    exit 1
it never reaches "exit 1" in the else branch, as the "usage" function exits with 0 itself
Comment 1 Eli Mesika 2013-08-01 07:19:55 EDT
fixed in commit: 78dca85
Comment 3 Charlie 2013-11-27 19:10:52 EST
This bug is currently attached to errata RHEA-2013:15231. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:


Thanks in advance.
Comment 4 errata-xmlrpc 2014-01-21 12:22:15 EST
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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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