Bug 1283760

Summary: coreutils: tail: inotify support changes behavior of -F with subdirs
Product: [Fedora] Fedora Reporter: Robbie Harwood <rharwood>
Component: coreutilsAssignee: Sebastian Kisela <skisela>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 26CC: admiller, kdudka, kzak, ovasik, p, rharwood, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: coreutils-8.27-5.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-01 18:16:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robbie Harwood 2015-11-19 18:30:02 UTC
When watching, e.g., `tail -F scratchdir/tests.log` with inotify
support, if scratchdir (and contents) ceases to exist and is re-created,
tail *will not* show the contents of the new file.

By contrast, with, e.g., `tail ---disable-inotify -F
scratchdir/tests.log`, when scratchdir (and contents) ceases to exist
and is re-created, tail *will* show the contents of the new file.

To my mind, the behavior *without* inotify is the correct one (it's
certainly the one that the description of "following names" from the man
page suggests to me) and the behavior *with* inotify is in error.

Thanks!

Comment 1 Kamil Dudka 2015-11-19 19:14:07 UTC
This appears to work just fine on my Fedora 23 box with an ext4 file system and coreutils-8.24-4.fc23.x86_64:

$ mkdir scratchdir
$ touch scratchdir/tests.log
$ tail -F scratchdir/tests.log &
[1] 5060
$ echo test > scratchdir/tests.log
test
$ rm scratchdir/tests.log
tail: ‘scratchdir/tests.log’ has become inaccessible: No such file or directory
$ echo test > scratchdir/tests.log
tail: ‘scratchdir/tests.log’ has appeared;  following new file
test

Please tell us:
- the exact NVR of coreutils
- the output of "uname -a"
- type of the file system in use
- what exactly you tried (a finite sequence of commands)
- what the actual result was

Comment 2 Kamil Dudka 2015-11-19 19:24:21 UTC
Looking once again, I figured out that you actually meant this:

$ rm -rf scratchdir

Then I am able to reproduce it on Fedora 23.  It indeed does not work.  I guess it is related to the following comment in tail's source code:

         FIXME: when using inotify, and a directory for a watched file
         is recreated, then we don't recheck any new file when
         follow_mode == Follow_name.

Comment 3 Robbie Harwood 2015-11-19 19:34:07 UTC
Yes, you are right; sorry for the confusion.

Comment 4 Fedora Admin XMLRPC Client 2016-06-13 09:05:29 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora End Of Life 2016-11-24 13:35:33 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2017-02-28 09:50:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 7 Kamil Dudka 2017-03-30 15:46:07 UTC
Reassigning to Sebastian Kisela, who is currently working on a patch for this.

Comment 8 Sebastian Kisela 2017-04-05 07:37:51 UTC
This issue is discussed also here:
http://lists.gnu.org/archive/html/bug-coreutils/2017-04/msg00005.html

Comment 9 Fedora Update System 2017-04-28 12:25:43 UTC
coreutils-8.27-5.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-b17d54561b

Comment 10 Fedora Update System 2017-04-28 13:05:57 UTC
coreutils-8.25-17.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-a9fd966808

Comment 11 Fedora Update System 2017-04-28 15:07:26 UTC
coreutils-8.25-9.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-fb8bb34a62

Comment 12 Fedora Update System 2017-04-30 02:23:48 UTC
coreutils-8.25-9.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-fb8bb34a62

Comment 13 Fedora Update System 2017-04-30 02:26:17 UTC
coreutils-8.25-17.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-a9fd966808

Comment 14 Fedora Update System 2017-04-30 03:51:48 UTC
coreutils-8.27-5.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-b17d54561b

Comment 15 Fedora Update System 2017-05-01 18:16:57 UTC
coreutils-8.27-5.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 16 Fedora Update System 2017-05-02 02:02:11 UTC
coreutils-8.25-17.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2017-05-15 04:26:24 UTC
coreutils-8.25-9.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.