GNU bug report logs -
#13183
tail -f ignores SIGPIPE
Previous Next
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.
Full log
Message #23 received at 13183 <at> debbugs.gnu.org (full text, mbox):
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
This bug report was last modified 6 years and 212 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.