Repository navigation
Conversation
With -F, tail only put an inotify watch on the directory of a followed file, while GNU also watches the file and drops that watch once the file is rotated away. The output was the same, but the GNU test tests/tail/inotify-rotate-resources.sh checks for these watches. Watch the file as well, and watch the new file again when it is reopened after a rotation. notify drops the old watch by itself once the name is renamed or removed. As both watches now report the name going away, report a missing file only once. The old watch is dropped before the old file is closed: closing a replaced file can free its inode, and the watch would then report the name as deleted. The polling backend keeps watching only the directory, since it reorders events when it watches both. Fixes uutils#16650
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When following a regular file on Linux, tail previously only placed an inotify watch on the parent directory (watching the file itself only for symlinks), whereas GNU tail also watches the file and drops that watch once the file is rotated. While the output of
tail -Fwas the same, the GNU testtests/tail/inotify-rotate-resources.shinspects the active inotify watches and failed because the file watch was missing.Under inotify (leaving the polling backend unchanged), tail now also watches the followed file across rotations, and a new test verifies the watched inodes via
/proc/<pid>/fdinfo.Closes #16650