Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2016 13:56:31 +0100
From:      Gary Palmer <gpalmer@freebsd.org>
To:        Gerhard Schmidt <estartu@ze.tum.de>
Cc:        Daniel Braniss <danny@cs.huji.ac.il>, freebsd-stable <freebsd-stable@freebsd.org>
Subject:   Re: Problems with piped tar
Message-ID:  <20160823125631.GC56297@in-addr.com>
In-Reply-To: <fcae3053-b1c1-98c3-106b-e003f0a30034@ze.tum.de>
References:  <96b7f57f-74ac-9445-1d04-61327ab111dc@ze.tum.de> <E0606B64-AF3A-4FB9-BCF8-9F7C7AE85FE7@cs.huji.ac.il> <6a841a00-6765-f1a2-02c3-9ce87ec595e8@ze.tum.de> <20160823113155.GB56297@in-addr.com> <fcae3053-b1c1-98c3-106b-e003f0a30034@ze.tum.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 23, 2016 at 02:27:46PM +0200, Gerhard Schmidt wrote:
> Am 23.08.2016 um 13:31 schrieb Gary Palmer:
> > On Tue, Aug 23, 2016 at 09:35:12AM +0200, Gerhard Schmidt wrote:
> >> Am 23.08.2016 um 09:18 schrieb Daniel Braniss:
> >>>
> >>>> On 23 Aug 2016, at 10:06, Gerhard Schmidt <estartu@ze.tum.de> wrote:
> >>>>
> >>>> Hi,
> >>>>
> >>>> i'm quite often use tar to copy files using
> >>>>
> >>>> tar cf - /some/dir | (cd /dest/dir; tar xvvf - )
> >>> the ???new??? way:
> >>> 	tar cf - /some/dir | tar xvvd - -C /dest/dir
> >>> which of course does not explain way your version hangs, but this one is cleaner, and btw, don???t
> >>> include /.
> >>
> >> that's very strange. It's working, but doesn't solve another related
> >> problem. When i pipe the tar thru nc a have the same problem as my
> >> version. And it's no difference if there is a tar c an the receiving end
> >> of nc or just a '> file.tar'
> > 
> > Is the sending side using nc -N ?  If not, the sending socket is not being
> > shut down.
> 
> Is that something new? Because it worked on freebsd9 without the -N option.

Yes.  It was introduced in 10.x for some reason.  It caught me out a few
times

> The problem seams to be that tar c doesn't terminate after the last File
> is send. I think it send the EOF (because nc -N terminates and therefor
> terminates the pipe) but the tar process doesn't terminate.

nc -N will terminate when the input pipe is closed AFAIK (i.e. the
process feeding into the pipe exits)

I presume you mean the tar process on the receiving side doesn't 
terminate?  Most odd.  I haven't tried tar across nc in a while,
I normally use dd or zfs send/receive

Regards,

Gary



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160823125631.GC56297>