Bug 11714 - bug with tar exit code.
Summary: bug with tar exit code.
Status: CLOSED DUPLICATE of bug 15448
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: tar   
(Show other bugs)
Version: 6.2
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-05-28 16:33 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-07-26 01:00:17 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description mal 2000-05-28 16:33:58 UTC
There is a bug with tar exit code.
Create a small file AA  (4 bytes),
and try to tar it to the tape /dev/st1
which does not exists.
tar prints error message (as it should be),
but exits with the code 0, what is incorrect.

echo AAA >AA
tar zcvf /dev/st1 AA
tar (grandchild): /dev/st1: Cannot open: No such device
tar (grandchild): Error is not recoverable: exiting now
but the exit code of tar iz 0.
This is incorrect.

In the same time when I am trying to tar
many files to a non-existing device /dev/st1
tar oftern (but not always) exits with the right (non-zero) exit code.

Comment 1 Derek Tattersall 2000-07-25 18:57:00 UTC
Can't reproduce this one on beta4.  tar is 1.13.17-6.

Comment 2 mal 2000-07-26 00:53:31 UTC
I do not have 1.13.17-6, I have 1.13.17-4 (from RedHat 6.2)
It is hard for me to try it, because 
new packages from Rawhide require rpm 4.0
what will probably require to upgrade half of the system.
Anyway, in 

#rpm -q tar
#rpm -q gzip

I have:

#tar --version
tar (GNU tar) 1.13.17
#gzip --version
gzip 1.3

#echo AAA >/tmp/AAA
#tar zcvf /dev/st1 /tmp/AAA
tar: Removing leading `/' from member names
tar (grandchild): /dev/st1: Cannot open: No such device
tar (grandchild): Error is not recoverable: exiting now
#echo $?

The error code may be non-zero on a bigger files.
In the same time  tar cvf /dev/st1 /tmp/AAA (without "z") always return
as it should be.

The problem with this tar exit code is that
even if backup failed there is no way to find this from 
the script.

Comment 3 mal 2000-07-26 01:00:15 UTC
Could you test the commands of above 
on plain RedHat 6.2 (tar 1.13.17-4) and then on
rawhide with tar 1.13.17-6.
If it exists in RedHat 6.2 and does not exist in rawhide-
the bug is probably fixed. 
If you can not reproduce it on RedHat 6.2 
you can send me URL for tar source you used, 
I will compile it and try.

Comment 4 Bernhard Rosenkraenzer 2000-08-07 14:43:29 UTC

*** This bug has been marked as a duplicate of 15448 ***

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