Project

General

Profile

Bug #18333

katello-backup returns with wrong exit code when failing

Added by Christine Fouant over 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1323607

Description of problem:

The katello-backup script calls tar to create backups. If tar is failing, i.e. No space left on device or i.e by just killing the tar process, the backup script returns zero.

As a consequence, the failure of the backups is not reported, in contrary all is looking fine. A restore attempt will fail.

Version-Release number of selected component (if applicable):
katello-common-2.2.0.18-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1./usr/bin/katello-backup /to/small/filesystem
2. tar: Removing leading `/' from member names

gzip: stdout: No space left on device
Done.
Backing up mongo db...
tar: Removing leading `/' from member names

gzip: stdout: No space left on device
Done.
[..]
  • BACKUP Complete, contents can be found in: /backup **
    [root@sat ~]#
    3. echo $?

Actual results:
0

Expected results:
1 (or anything else non-zero

Additional info:

The script should look something like:
tar --selinux -czf config_files.tar.gz ${CONFIGS[*]} || exit $? to catch the exit code of tar

Associated revisions

Revision af3a5bc0 (diff)
Added by Pat Riehecky over 2 years ago

Fixes #18333 katello-backup returns 0 exit code even when failing

Revision a5593c5f (diff)
Added by Pat Riehecky over 2 years ago

Fixes #18333: run_cmd takes exit status args

History

#1 Updated by Christine Fouant over 2 years ago

  • Project changed from Katello to Packaging
  • Category deleted (Backup & Restore)

#2 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello-packaging/pull/379 added

#3 Updated by Eric Helms over 2 years ago

  • Project changed from Packaging to Katello
  • Pull request deleted (https://github.com/Katello/katello-packaging/pull/379)

#4 Updated by Eric Helms over 2 years ago

  • Legacy Backlogs Release (now unused) set to 211
  • Pull request https://github.com/Katello/katello-packaging/pull/379 added

#5 Updated by Christine Fouant over 2 years ago

  • Project changed from Katello to Packaging

#6 Updated by Pat Riehecky over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by The Foreman Bot over 2 years ago

  • Pull request https://github.com/Katello/katello-packaging/pull/405 added

#8 Updated by Christine Fouant over 2 years ago

  • Status changed from Closed to Ready For Testing

#9 Updated by Pat Riehecky over 2 years ago

  • Status changed from Ready For Testing to Closed

#10 Updated by Eric Helms over 2 years ago

  • Project changed from Packaging to Katello
  • Pull request deleted (https://github.com/Katello/katello-packaging/pull/405, https://github.com/Katello/katello-packaging/pull/379)

Also available in: Atom PDF