Google Grupper understøtter ikke længere nye Usenet-opslag eller -abonnementer. Tidligere indhold er fortsat synligt.

tar exit values (return codes)

30 visninger
Gå til det første ulæste opslag

Ian Wilson

ulæst,
27. mar. 2003, 06.03.4727.03.2003
til
For 'tar cf /dev/rSt0' in OSR505 I find that return codes are as follows
0 when no problems occurred.
6 when no tape in drive.
16 when someone else is using the device.

is there a full list of return codes and meanings?

--
Ian Wilson.

Ian Wilson

ulæst,
27. mar. 2003, 07.06.0427.03.2003
til

Ian Wilson wrote:

More info,
Its a SCSI tape device, a DAT, DDS-2.
I have ...
googled
read the FAQ
man HW SCSItape
pg /usr/include/sys/Stp.h (interesting but no correspondence)

143 when tar is SIGTERMed
5 when tape is write protected
130 when tar is INTERRUPTed
Empiric methods can be so slow!

Stand by whilst I discover the exit code for "tape drive on fire" ...

--
Ian Wilson.


Mike Brown

ulæst,
27. mar. 2003, 10.06.4827.03.2003
til

/usr/include/sys/tape.h is a starting point. The structure tape_status
has write protected as its 5th element, no media as the 6th.

Mike

--
Michael Brown

The Kingsway Group

John DuBois

ulæst,
27. mar. 2003, 19.53.0027.03.2003
til
In article <3E82E922...@infotop.co.uk>,

Ian Wilson <scob...@infotop.co.uk> wrote:
>
>Ian Wilson wrote:
>
>> For 'tar cf /dev/rSt0' in OSR505 I find that return codes are as follows
>> 0 when no problems occurred.
>> 6 when no tape in drive.
>> 16 when someone else is using the device.
>>
>> is there a full list of return codes and meanings?

Unfortunately, no.

>143 when tar is SIGTERMed
>5 when tape is write protected
>130 when tar is INTERRUPTed
>Empiric methods can be so slow!
>
>Stand by whilst I discover the exit code for "tape drive on fire" ...

Values over 128 represent the OR'ing of 128 with a signal that killed tar (or
any other program). SIGINT = 2; 128 + 2 = 130; SIGTERM = 15 ...

Skimming the tar source turns up these exit codes:

0 - success
1 - bad directory tree, failed to extract a requested file,
input file same as output file, failed to open input file,
could not create link, link table malloc failure
2 - internationalization error that should never occur,
checksum error
5 - checksum error
9 (EBADF) - error reading /etc/default/tar, misplaced end of volume
12 (ENOMEM) - failure to allocate memory for buffer
22 (EINVAL) - bad invokation (argument syntax errors),
bad parameters to options
28 (ENOSPC) - file too large for a volume
78 (ENAMETOOLONG) - cwd name too long
171 (ETOAST) - tape drive on fire
fork()/execl() errno if /bin/pwd & /usr/bin/pwd cannot be executed (unlikely)
pipe(), fork(), and execl() errnos for problems in creating pipe to compressor
read()/write() errno - tape read/write error
fopen() errno - failure to create tempfile
creat() errno - could not create output file
write() errno - failure to write extracted file
mkdir() errno - failure to make directory
dup()/open() errno - failure to reopen input/output
lseek()/reak() errno - failure to seek/skip on archive
fopen(), fread() errno - failure to read from file list file

You got 5 for a write-protected tape because that's the errno EIO (I/O error).

John
--
John DuBois spc...@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/

Ian Wilson

ulæst,
28. mar. 2003, 05.37.3528.03.2003
til

John DuBois wrote:


Thanks John and Mike. Especially for the info re error 171 - I can put
my box of matches away now.

--
Ian Wilson.

0 nye opslag