On Wed, Feb 27, 2002 at 12:51:33PM -0500, Chris Dahn wrote:
> On Monday 25 February 2002 11:29 am, Carl Wilhelm Soderstrom wrote:
> > due to permission problems, we've had repeated cases of tar returning error
> > message '2', even tho amanda uses the --ignore-failed-read option (tar
> > 1.3.25). as I understand it, amanda should still accept the backup data
> > that tar got, but it doesn't. it simply ignores the backup.
> >
> > is there an option I need to turn on at compile time, or is there something
> > I can set somewhere? my searches turned up a mail-list message (which I
> > can't seem to find again), which said 'update to tar 1.3.19 or amanda
> > 2.4.2p2'; but after surpassing both of those things (currently amanda
> > 2.4.3b2 and tar 1.3.25), it's still no luck. :(
> >
> > Carl Soderstrom.
> 
>   Yes, I just started having the same problem due to a filesystem 
> inconsistency. Tar gets lots and lots of data, then returns '2', so all of it 
> is lost. I'm running redhat 2.4.16, tar 1.13.19.
> 
>>> End of included message <<<

I don't know the real fix, but what I see is this:

  --ignore-failed-read   is a gnutar option that allows it to continue on
  file read errors, just skipping the file on which it encounters the error
  and setting a flag.

  At termination, gnutar checks the flag and if set, exits with status 2
  indicating some read errors.  But otherwise the tarchive is ok.

  If the next component merely checks exit status non-zero, it thinks there was
  a failed tar and doesn't use the tarchive.

One crude way to fix it is mess with the last few lines of tar.c,
i.e. the end of main.  The original is:

      if (exit_status == TAREXIT_FAILURE)
          error (0, 0, _("Error exit delayed from previous errors"));
      exit (exit_status); 
  }

TAREXIT_FAILURE is defined as to 2, and exit_status is our flag of read error.

In the if statement, force exit_status to zero.  An error message will still
be printed, but it will look to the next component like everything was ok.

Crude, but if you are using a special copy of gnutar for amanda only, maybe ok.

-- 
Jon H. LaBadie                  [EMAIL PROTECTED]
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

Reply via email to