From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 11:39:26 2017 Received: (at submit) by debbugs.gnu.org; 18 Jan 2017 16:39:26 +0000 Received: from localhost ([127.0.0.1]:34895 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTtGf-0006Xg-Pv for submit@debbugs.gnu.org; Wed, 18 Jan 2017 11:39:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTtGe-0006XT-3G for submit@debbugs.gnu.org; Wed, 18 Jan 2017 11:39:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTtGY-0007t3-1H for submit@debbugs.gnu.org; Wed, 18 Jan 2017 11:39:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTtGX-0007sw-Th for submit@debbugs.gnu.org; Wed, 18 Jan 2017 11:39:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cTtGW-0006kx-Oe for bug-coreutils@gnu.org; Wed, 18 Jan 2017 11:39:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cTtGR-0007nj-TC for bug-coreutils@gnu.org; Wed, 18 Jan 2017 11:39:16 -0500 Received: from smtp6-g21.free.fr ([212.27.42.6]:45593) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cTtGR-0007nC-Kx for bug-coreutils@gnu.org; Wed, 18 Jan 2017 11:39:11 -0500 Received: from [192.168.22.29] (unknown [88.170.160.103]) (Authenticated sender: f0rhum) by smtp6-g21.free.fr (Postfix) with ESMTPSA id D09CB780407 for ; Wed, 18 Jan 2017 17:39:08 +0100 (CET) To: bug-coreutils@gnu.org From: f0rhum Subject: tail -f behaviour X-Enigmail-Draft-Status: N1110 Message-ID: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> Date: Wed, 18 Jan 2017 17:39:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hi This is about tail v5.97 I have a log file that is updated every 5mn, a timestamped message being appended to a new line at the end On the third time an indentical message would be writen, the last line is replaced by "..." then the message is writen Tracking changes with tail -f stops after this, which may be intended behaviour as man states "as the file grows". Although, when pruning a bunch of lines from the head of the file, then a yet running tracking still won't update even the file size grows, like if the file size was grabbed on the very beginning of the command and never updated on each iteration. To be honest, I didn't try to see what happens if I prune a single line and see what the next 2nd and further iterations show. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 13:33:40 2017 Received: (at 25475) by debbugs.gnu.org; 18 Jan 2017 18:33:41 +0000 Received: from localhost ([127.0.0.1]:34972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTv3E-0000pD-LL for submit@debbugs.gnu.org; Wed, 18 Jan 2017 13:33:40 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:61094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTv3C-0000oy-2Q for 25475@debbugs.gnu.org; Wed, 18 Jan 2017 13:33:38 -0500 Received: from [192.168.101.10] ([217.86.87.177]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id 0MDpnS-1cCpCm2lpu-00HAGe; Wed, 18 Jan 2017 19:33:30 +0100 Subject: Re: bug#25475: tail -f behaviour To: f0rhum , 25475@debbugs.gnu.org References: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> From: Bernhard Voelker Message-ID: <95ad35dd-5af5-cb8b-8b82-51934754af10@bernhard-voelker.de> Date: Wed, 18 Jan 2017 19:33:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:bAOVDHlpD7cZPFykTUlggvaYuVV6NeatVt/x/IrUXgHd6MiSteX zTK+xnq/6oiGh+aaIfg2rItY2vVjLVxT10mATVpOKe5M5HcxjzDHsq39olZySRmVN4Lr7PC 9g9gMiG0ur2xVTRXKn4BCJ7yLyFItntCd6nYUcbxrRS7QNvyn3KC06+mnrUd87zLWNHNuVf 80hzRUeZ8T/MzE1OHSOIA== X-UI-Out-Filterresults: notjunk:1;V01:K0:xRq3tWD2Ywk=:LohKZwyP83S0cMT+dRWgMk b0qbd+lGCklVki8q8xjKt7UASwziSng3xKeO+2UKhXOY3+TZknJAHH+YFrLVO/0/fYg62uvwS czjJbnRFclWCsv6KiQ1+JvrTu76ajHBW2GhehZ/+syS4WqgpxGT5Y2SV659ePqwFcD6Tzgm/x zXyzU8W6usQ4AAEUBc9iQ4ys8/0H6z/so5V4ESntUhOae+MWmusVMRNF7GbVVH/K+K79eNdDn OLpVVImxQzyZJOps/yvJiw3RcD4jhye/Zxcs3S8NVmSb6su/4T7WQGPIi7RbJfK2ARGasK9Uh ejSS0FUKhR71jntp+z0SVqavQDQAADMy06rw7mIObM3+XjIUPNht6/gUmGBcsuS79iBtw2jWE Fx0GvW5jWznKn+W4j6whfMHoYNYOAKFaN+wUoksLdSyRtIKmxFHkWXqYTtMSELpu+a/wCkGvg 2EXO7XznGjttEU7GqGpK9gMHgQAJAX1BarC0Dnx3B80JvqYSb8d4oRXTSuxTIQW/zu3YHprRd Ov0wzFvzRg0cISacxPBAWR18zkX9Lev++U3EEGC1UELOdeAvjMK3GGWYSpE/wBN5w4GTGsWhS kawlZU9Lcsb5J2FbHpG2h8wyt9QfWTDhd5qkjpy9ZLByBFV7VVUaXylZ0IfH5sNtZlS2kqogX kb/twoCgo96W7J3RtMMG944UklDFpZVBosxXW4T3lqdMZ+uHO8BoO4bEv0xzCUbGgJtaFajFM +U/4U3VLbVToxfAi X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25475 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 01/18/2017 05:39 PM, f0rhum wrote: > Hi > This is about tail v5.97 First of all, this is a ~10 years old version. Even if this turns out to be a bug in the software, you won't get any support for it. Did you try the latest version (8.26)? > I have a log file that is updated every 5mn, a timestamped message being > appended to a new line at the end > On the third time an indentical message would be writen, the last line > is replaced by "..." then the message is writen > > Tracking changes with tail -f stops after this, which may be intended > behaviour as man states "as the file grows". > > Although, when pruning a bunch of lines from the head of the file, then a > yet running tracking still won't update even the file size grows, like if the file size was > grabbed on the very beginning of the command and never updated on each > iteration. > > To be honest, I didn't try to see what happens if I prune a single line > and see what the next 2nd and further iterations show. To be honest, I do not understand what you mean by "pruning" in this context, so I'm confused about what is going on. Can you provide a simple example like: touch file tail -f file & sleep 2 printf "some line\n" >> file sleep 2 printf "only some words ..." >> file sleep 2 printf "... on a continued line ..." >> file sleep 2 printf "... which is now terminated\n" >> file sleep 2 kill $! wait $! Thanks & have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 13:37:05 2017 Received: (at 25475) by debbugs.gnu.org; 18 Jan 2017 18:37:05 +0000 Received: from localhost ([127.0.0.1]:34981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTv6X-0000uf-Dm for submit@debbugs.gnu.org; Wed, 18 Jan 2017 13:37:05 -0500 Received: from midir.magicbluesmoke.com ([82.195.144.46]:41786 helo=mail.magicbluesmoke.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTv6V-0000uJ-2I for 25475@debbugs.gnu.org; Wed, 18 Jan 2017 13:37:04 -0500 Received: from [192.168.1.80] (unknown [109.77.132.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 834F94ADF; Wed, 18 Jan 2017 18:37:01 +0000 (GMT) Subject: Re: bug#25475: tail -f behaviour To: f0rhum , 25475@debbugs.gnu.org References: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <96d2256e-4090-5cbe-9b4b-50cfc7c6047e@draigBrady.com> Date: Wed, 18 Jan 2017 18:37:01 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 25475 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 18/01/17 16:39, f0rhum wrote: > Hi > This is about tail v5.97 > I have a log file that is updated every 5mn, a timestamped message being > appended to a new line at the end > On the third time an indentical message would be writen, the last line > is replaced by "..." then the message is writen > > Tracking changes with tail -f stops after this, which may be intended > behaviour as man states "as the file grows". > > Although, when pruning a bunch of lines from the head of the file, then a > yet running tracking still won't update even the file size grows, like if the file size was > grabbed on the very beginning of the command and never updated on each > iteration. > > To be honest, I didn't try to see what happens if I prune a single line > and see what the next 2nd and further iterations show. I think you're saying that your file is truncated in place. tail(1) doesn't handle that well and expects files to be increasing, and maybe rotated (which is handled with -F). Newer versions of tail(1) will show the whole file again once it detects truncation (as usually a truncated file is truncated to nothing before new data is written). cheers, Padraig From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 18:44:35 2017 Received: (at 25475) by debbugs.gnu.org; 18 Jan 2017 23:44:35 +0000 Received: from localhost ([127.0.0.1]:35066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTzu6-0001Qg-VA for submit@debbugs.gnu.org; Wed, 18 Jan 2017 18:44:35 -0500 Received: from smtp6-g21.free.fr ([212.27.42.6]:33893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTzu5-0001QX-Lk for 25475@debbugs.gnu.org; Wed, 18 Jan 2017 18:44:34 -0500 Received: from [192.168.22.29] (unknown [88.170.160.103]) (Authenticated sender: f0rhum) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 279B17802C5 for <25475@debbugs.gnu.org>; Thu, 19 Jan 2017 00:44:30 +0100 (CET) Subject: Re: bug#25475: tail -f behaviour To: 25475@debbugs.gnu.org References: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> <96d2256e-4090-5cbe-9b4b-50cfc7c6047e@draigBrady.com> From: f0rhum X-Enigmail-Draft-Status: N1110 Message-ID: Date: Thu, 19 Jan 2017 00:44:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <96d2256e-4090-5cbe-9b4b-50cfc7c6047e@draigBrady.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25475 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tail -fn20 -s30 file ... 2017-01-18 22:55:00 10 0V18 +1C 0A00 500mA 11V70 20% 2A30 11861 Date Heure Mes. Vpan. Tmp. Ich. Conso Vbat. SoC Sta Vin mV 2017-01-18 23:00:01 10 0V17 +1C 0A00 500mA 11V71 19% 2A30 11879 2017-01-18 23:05:00 10 0V17 +0C 0A00 480mA 11V71 20% 2A30 11868 2017-01-18 23:10:00 10 0V18 +0C 0A00 500mA 11V70 19% 2A30 11865 2017-01-18 23:15:00 10 0V16 +0C 0A00 510mA 11V69 19% 2A30 11832 --> Vbat<11V70: Delestage automatique de 9h08mn 2017-01-18 23:20:21 Controleur inaccessible 2017-01-18 23:25:21 Controleur inaccessible ^C tail -fn20 -s30 file ... 2017-01-18 22:55:00 10 0V18 +0C 0A00 500mA 11V70 20% 2A30 11861 Date Heure Mes. Vpan. Tmp. Ich. Conso Vbat. SoC Sta Vin mV 2017-01-18 23:00:01 10 0V17 +1C 0A00 500mA 11V71 19% 2A30 11879 2017-01-18 23:05:00 10 0V17 +0C 0A00 480mA 11V71 20% 2A30 11868 2017-01-18 23:10:00 10 0V18 +0C 0A00 500mA 11V70 19% 2A30 11865 2017-01-18 23:15:00 10 0V16 +0C 0A00 510mA 11V69 19% 2A30 11832 --> Vbat<11V70: Delestage automatique de 9h08mn 2017-01-18 23:20:21 Controleur inaccessible ... 2017-01-19 00:10:04 Controleur inaccessible For the 2 above, I didn't delete any line above. Only the line 23:25:21 in the first was replaced by my script with ... 23:30:xx .... <--- which in turn was updated by a new similar messages until a different message happens (note here this is an additionnal line) I didn't have the idea that "file grows" can have 2 meaning : grows in bytes, or grows in line numbers. Whatever, a new line was added between iterations (one deleted then immediately 2 added), and 3 bytes added (43 deleted (then sed -i '$ d' $LOGF;), then immediately 3 + 43 printed immediately in a single write (help of printf "...\n%s Controleur inaccessible\n" "`date "+%F %X"`" >>$LOGF ) I must also clarify something : this not an issue for me, I just wanted to share what I discovered. I just discovered -f was great live help while tracking bugs in my script. Bye bye From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 18 19:05:31 2017 Received: (at 25475) by debbugs.gnu.org; 19 Jan 2017 00:05:32 +0000 Received: from localhost ([127.0.0.1]:35071 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU0EN-0001vv-Nk for submit@debbugs.gnu.org; Wed, 18 Jan 2017 19:05:31 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:56302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU0EM-0001vi-2D for 25475@debbugs.gnu.org; Wed, 18 Jan 2017 19:05:30 -0500 Received: from [192.168.101.10] ([217.86.87.177]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Lr6Jj-1c0BOK2nOF-00eYs6; Thu, 19 Jan 2017 01:05:23 +0100 Subject: Re: bug#25475: tail -f behaviour To: f0rhum , 25475@debbugs.gnu.org References: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> <96d2256e-4090-5cbe-9b4b-50cfc7c6047e@draigBrady.com> From: Bernhard Voelker Message-ID: <861ceee8-525e-7b25-8abb-5590594a32ff@bernhard-voelker.de> Date: Thu, 19 Jan 2017 01:05:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:q5ywxp85IiszyEjB/JmXfGI0FjbKDyGyJcxPrlDqoqxM2DTTY39 CTOqMPUuwWfll/aqpyp+5Lz1AiL6Ko1aBpU4D5U6DMGsb8mLncSkef+CFTw0k1eQdsuWhxs sJCzhPBkD1CDkrXhezKMGdI3D5rC0hGGbIYUjR0NrS034/j7txb8MqRseE3yUk8iI8TnQvb h2TiTsPdMnQo2l3P+c1qw== X-UI-Out-Filterresults: notjunk:1;V01:K0:WaUksa5LjY4=:d/EJyAFjT3OF/c7kFCK/9V pQ+aVFwHIj5WWrjxXnA+SaqykqTUIrbwrNuYmh9npGD2O7kZdb41SMswc1dDExOe3ieaUoMPx b/Om4Lwn/8jjPFc5fhXvLxUdzFStHw2glD2r37vT8HoyI+jLRp+/4bWr4t/4QWi6L/4cin51l poinEEFU/piU98/Sv5bN/ae2PlT+d+XVLlRLJ8zPPjy6SIL7aAH9NqnZAVS88Zb4ETzhTqcdq dWImd2QXwmC21+rqQj0cCQEZNxSaIqakWclh6r/IUuXQrR+agsqxZ1hk/QxB26FhcMyWaEQ4l 4iEfctaapK3wp4GHXQHVhtN0qIxpOagJzQcpFg1l2vQ5Oy+1tnnAdrRHfqKNZr94jcka35y0Z SSy55rFSrP2bKBqTeSplqhYzSb0EMd/V5VXp5IRGQu0B49TUEzi46iW1dYc2sDZLjzAIpsFUC AeTinzxBsy4BO8araneCDQ8/FCmz5PnCcsmBBIOJ3+rsIvI0ufXVVG8g8OChQh063T5qtgAUV 6QOWoG4ntexSA2tDfVrqzh09vkad1ocLKQGNnQSJ1BzY5mhX/qW6MKPnb2rgTtRpoMF8gFS0O CncNNzb3E3LdRp4i9xYKgw9M2KVXcK1lqVDRzrS+ZSPUsyiWkm37Iu+v70BTs0ifPo5u7q+48 lD53hj01TGTWbiQ3gzJWhDlY0Sd7+Xp4Gxmbjb3Fk+VewUZ4pmSYdsj92CPvbHlwKxXIMT5wz g9bCcpfO3ucA1wfm X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25475 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) tag 25475 notabug close 25475 stop On 01/19/2017 12:44 AM, f0rhum wrote: > deleted (then sed -i '$ d' $LOGF;), then immediately 3 + 43 printed ________________^^^^^^^^^^^^^^^^^^ That's the reason: "sed -i" opens a new, temporary file and filters the original content from 'file' to the new one; finally, it renames the temporary file to the original file name: $ strace -e open,read,write,rename sed -i '$ d' file ... open("file", O_RDONLY) = 3 open("./sedLPtf2x", O_RDWR|O_CREAT|O_EXCL, 0600) = 4 read(3, "xxx\n"..., 4096) = 953 write(4, "xxx\n", 4) = 4 ... read(3, "", 4096) = 0 read(3, "", 4096) = 0 rename("./sedLPtf2x", "file") = 0 +++ exited with 0 +++ The file has the same name, but the file descriptor that tail opened at startup is a different one. You can also see that the inode number of the file changes: $ ls -logi file 5770837 -rw-r--r-- 1 817 Jan 19 00:54 file $ sed -i '$ d' file $ ls -logi file 5774048 -rw-r--r-- 1 751 Jan 19 01:00 file As "tail -f" means to follow the original file descriptor, it is not supposed to follow the new file (which has the same name): -f, --follow[={name|descriptor}] output appended data as the file grows; an absent option argument means 'descriptor' As such, there is no bug in tail; therefore I'm marking it as such, and close this issue in our bug tracker. Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 19 03:36:17 2017 Received: (at 25475) by debbugs.gnu.org; 19 Jan 2017 08:36:17 +0000 Received: from localhost ([127.0.0.1]:35172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU8Cf-0000bQ-6e for submit@debbugs.gnu.org; Thu, 19 Jan 2017 03:36:17 -0500 Received: from smtp6-g21.free.fr ([212.27.42.6]:30248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU8Cd-0000bG-G1 for 25475@debbugs.gnu.org; Thu, 19 Jan 2017 03:36:15 -0500 Received: from [192.168.22.29] (unknown [88.170.160.103]) (Authenticated sender: f0rhum) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 6AADA7803E3; Thu, 19 Jan 2017 09:36:10 +0100 (CET) Subject: Re: bug#25475: tail -f behaviour To: Bernhard Voelker , 25475@debbugs.gnu.org References: <2d2340ef-2114-913c-f975-aab7177622cf@free.fr> <96d2256e-4090-5cbe-9b4b-50cfc7c6047e@draigBrady.com> <861ceee8-525e-7b25-8abb-5590594a32ff@bernhard-voelker.de> From: f0rhum X-Enigmail-Draft-Status: N1110 Message-ID: <3b9d6ef3-b0a1-ea57-6d34-08566a83103f@free.fr> Date: Thu, 19 Jan 2017 09:36:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <861ceee8-525e-7b25-8abb-5590594a32ff@bernhard-voelker.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 25475 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Le 19/01/2017 à 01:05, Bernhard Voelker wrote : > tag 25475 notabug > close 25475 > stop > > > On 01/19/2017 12:44 AM, f0rhum wrote: >> deleted (then sed -i '$ d' $LOGF;), then immediately 3 + 43 printed > ________________^^^^^^^^^^^^^^^^^^ > > That's the reason: "sed -i" opens a new, temporary file and filters the > original content from 'file' to the new one; finally, it renames the > temporary file to the original file name: > > $ strace -e open,read,write,rename sed -i '$ d' file > ... > open("file", O_RDONLY) = 3 > open("./sedLPtf2x", O_RDWR|O_CREAT|O_EXCL, 0600) = 4 > read(3, "xxx\n"..., 4096) = 953 > write(4, "xxx\n", 4) = 4 > ... > read(3, "", 4096) = 0 > read(3, "", 4096) = 0 > rename("./sedLPtf2x", "file") = 0 > +++ exited with 0 +++ > > The file has the same name, but the file descriptor that tail opened > at startup is a different one. You can also see that the inode number > of the file changes: > > $ ls -logi file > 5770837 -rw-r--r-- 1 817 Jan 19 00:54 file > > $ sed -i '$ d' file > > $ ls -logi file > 5774048 -rw-r--r-- 1 751 Jan 19 01:00 file > > As "tail -f" means to follow the original file descriptor, it is > not supposed to follow the new file (which has the same name): > > -f, --follow[={name|descriptor}] > output appended data as the file grows; > an absent option argument means 'descriptor' > > As such, there is no bug in tail; therefore I'm marking it as such, > and close this issue in our bug tracker. > > Have a nice day, > Berny Thank you very much Bernie I won you taught me huge knowledge (descriptor and related, that was mysterious to me when reading the man) Thanks too to all you GNU enthusiasts heavy workers From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 28 03:50:25 2018 Received: (at control) by debbugs.gnu.org; 28 Oct 2018 07:50:25 +0000 Received: from localhost ([127.0.0.1]:46519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGfq5-0000Js-AW for submit@debbugs.gnu.org; Sun, 28 Oct 2018 03:50:25 -0400 Received: from mail-it1-f181.google.com ([209.85.166.181]:50495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gGfq4-0000Jb-2C for control@debbugs.gnu.org; Sun, 28 Oct 2018 03:50:24 -0400 Received: by mail-it1-f181.google.com with SMTP id k206-v6so6098284ite.0 for ; Sun, 28 Oct 2018 00:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=s1U7RWAUEulO0+FhzBQuWPazVErtp2Tx8WERzZ76uyc=; b=OLmWNtyzmHussfOPR2pipLqSZgzR6HHo2uvBBZZEiSLUpbiGTPiGsf5Jv4euymaqiR yMhQN8xvi9NaNbL9pq2HDCaLfIOtTErd/ox2t17ocQFaDrMH893fsTxBxYoigiRTaxX6 XyF5dLpUb+oCLkQwMvQ/8lJhXOEi29Kg2AqKUlsRkdgpFe3SdZk27yNMKSeUfOCtRBEd XdogVjjt985XBXnwzbZCbTWfHueoenlbHpMf4O1/2irkZqcu/RYReyamfM7qm9FobSfi CyQT1H70LFtzBnRuEthOFijb1uqqGiZAF4oRENcU4QnOZE5PePSPDeDGg8iD2/mCldRT KkHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=s1U7RWAUEulO0+FhzBQuWPazVErtp2Tx8WERzZ76uyc=; b=hy6hDCe1S1uf0yv/UGVhbeCa74prw4dD9gvUgUSsmLNfwvPgjsdsdsYFgUSiBZVZhK lWyC9HjZqO8rrGCnv8kDYX3xiAadoL9ENhx+c2hYEdcTdxTUKH+Gk08AM42RIBqrUZsL 1ieYe5HAqPPSSKA/0saBCUdwZG34HxJ2NNfoqfFa8vQB7voOR9lKCziMyCrcL/MtyW1Z k6ywXlV0fWzxkM1Nf0AOhv334bZ06FnT6gzUt86M1bStySZL5200fN/mi7swRBa9XXe5 H40Dwo080frPFFC9tuiHfmwLbHp83KtudJ/Z2tuNIgx7TGbHMt6n+wZBbVq6zEYZIJ03 VZkA== X-Gm-Message-State: AGRZ1gJs+1hEGcKN0PH3bmHbm9dgMzaFWUDYWfWjqLcDBrjq+0hfOO7p gVB17POxH2TNmFvoa/X57SjSXymSqsg= X-Google-Smtp-Source: AJdET5cYTBTGctwNpKA0paUabCVXd/9e2ceqz95SxOMX3FOMx+6F0jhkHcRUcubWjFsD6M/7uAgYXQ== X-Received: by 2002:a24:24c9:: with SMTP id f192-v6mr6580943ita.144.1540713018050; Sun, 28 Oct 2018 00:50:18 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id e76-v6sm5420015iof.31.2018.10.28.00.50.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 00:50:16 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: Date: Sun, 28 Oct 2018 01:50:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 25475 notabug close 25475 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.181 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.166.181 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 25475 notabug close 25475 From unknown Mon Aug 18 11:30:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 25 Nov 2018 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator