GNU bug report logs - #13183
tail -f ignores SIGPIPE

Previous Next

Package: coreutils;

Reported by: Ruediger Meier <sweet_f_a <at> gmx.de>

Date: Fri, 14 Dec 2012 14:06:01 UTC

Severity: wishlist

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13183 in the body.
You can then email your comments to 13183 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#13183; Package coreutils. (Fri, 14 Dec 2012 14:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ruediger Meier <sweet_f_a <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 14 Dec 2012 14:06:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ruediger Meier <sweet_f_a <at> gmx.de>
To: bug-coreutils <at> gnu.org
Subject: tail -f ignores SIGPIPE
Date: Fri, 14 Dec 2012 15:04:28 +0100
Hi,

I want to use tail and grep to follow a file until a particular pattern 
appears. But tail does not exit when grep is finished.

$ echo xxx > /tmp/blabla
$ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx"
xxx

Now tail still tries to read and exits only if I write again 
into /tmp/blabla.

Is this how it's supposed to be?

cu,
Rudi




Information forwarded to bug-coreutils <at> gnu.org:
bug#13183; Package coreutils. (Fri, 14 Dec 2012 14:35:01 GMT) Full text and rfc822 format available.

Message #8 received at 13183 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Ruediger Meier <sweet_f_a <at> gmx.de>
Cc: 13183 <at> debbugs.gnu.org
Subject: Re: bug#13183: tail -f ignores SIGPIPE
Date: Fri, 14 Dec 2012 14:33:29 +0000
tag 13183 + notabug
close 13183
stop

On 12/14/2012 02:04 PM, Ruediger Meier wrote:
> Hi,
>
> I want to use tail and grep to follow a file until a particular pattern
> appears. But tail does not exit when grep is finished.
>
> $ echo xxx > /tmp/blabla
> $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx"
> xxx
>
> Now tail still tries to read and exits only if I write again
> into /tmp/blabla.
>
> Is this how it's supposed to be?

tail does exit on SIGPIPE, however it will
only get the signal on write(), and so you
need to get more data in the file before tail will exit.

thanks,
Pádraig.




Added tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 14 Dec 2012 14:35:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 13183 <at> debbugs.gnu.org and Ruediger Meier <sweet_f_a <at> gmx.de> Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Fri, 14 Dec 2012 14:35:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 Jan 2013 12:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 10 Feb 2015 15:16:02 GMT) Full text and rfc822 format available.

Removed tag(s) notabug. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 10 Feb 2015 15:16:03 GMT) Full text and rfc822 format available.

Severity set to 'wishlist' from 'normal' Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Tue, 10 Feb 2015 15:16:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#13183; Package coreutils. (Sun, 15 Feb 2015 19:15:03 GMT) Full text and rfc822 format available.

Message #23 received at 13183 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: 13183 <at> debbugs.gnu.org
Subject: Re: bug#13183: tail -f ignores SIGPIPE
Date: Sun, 15 Feb 2015 19:14:33 +0000
On 14/12/12 14:33, Pádraig Brady wrote:
> tag 13183 + notabug
> close 13183
> stop
> 
> On 12/14/2012 02:04 PM, Ruediger Meier wrote:
>> Hi,
>>
>> I want to use tail and grep to follow a file until a particular pattern
>> appears. But tail does not exit when grep is finished.
>>
>> $ echo xxx > /tmp/blabla
>> $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx"
>> xxx
>>
>> Now tail still tries to read and exits only if I write again
>> into /tmp/blabla.
>>
>> Is this how it's supposed to be?
> 
> tail does exit on SIGPIPE, however it will
> only get the signal on write(), and so you
> need to get more data in the file before tail will exit.

It's a fair point though that tail, since it
can hang around forever should take special
steps to be responsive to the other end of the pipe going away.
I.E. it might use select() or poll(POLLHUP), to detect
immediately/periodically the other end of the pipe going away.

thanks,
Pádraig.

p.s. bug marked as wishlist




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 Mar 2015 11:24:04 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pádraig Brady <P <at> draigBrady.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 16:23:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#13183; Package coreutils. (Sat, 27 Oct 2018 16:42:02 GMT) Full text and rfc822 format available.

Message #30 received at 13183-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: 13183-done <at> debbugs.gnu.org
Subject: Re: bug#13183: tail -f ignores SIGPIPE
Date: Sat, 27 Oct 2018 09:41:57 -0700
On 15/02/15 11:14, Pádraig Brady wrote:
> On 14/12/12 14:33, Pádraig Brady wrote:
>> tag 13183 + notabug
>> close 13183
>> stop
>>
>> On 12/14/2012 02:04 PM, Ruediger Meier wrote:
>>> Hi,
>>>
>>> I want to use tail and grep to follow a file until a particular pattern
>>> appears. But tail does not exit when grep is finished.
>>>
>>> $ echo xxx > /tmp/blabla
>>> $ tail -f /tmp/blabla |grep -m1 --line-buffered "xxx"
>>> xxx
>>>
>>> Now tail still tries to read and exits only if I write again
>>> into /tmp/blabla.
>>>
>>> Is this how it's supposed to be?
>>
>> tail does exit on SIGPIPE, however it will
>> only get the signal on write(), and so you
>> need to get more data in the file before tail will exit.
> 
> It's a fair point though that tail, since it
> can hang around forever should take special
> steps to be responsive to the other end of the pipe going away.
> I.E. it might use select() or poll(POLLHUP), to detect
> immediately/periodically the other end of the pipe going away.

Implemented in:
https://git.sv.gnu.org/cgit/coreutils.git/commit/?id=v8.27-42-gce0415f

cheers,
Pádraig





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Nov 2018 12:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.