Repository navigation
Conversation
|
Binary size comparison: |
|
GNU testsuite comparison: |
ed24981 to
5b650d3
Compare
5b650d3 to
19b2902
Compare
19b2902 to
02c7ed7
Compare
|
With this change, the inotify watches on the followed file are now added and removed across rotations as expected (verified with However, How would you prefer to proceed: adjusting the GNU test to use |
02c7ed7 to
76e9058
Compare
76e9058 to
56a22a5
Compare
56a22a5 to
eb8884e
Compare
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. A file that cannot be watched, such as an unreadable one, is still followed through its directory. Part of uutils#16650
eb8884e to
bb1420c
Compare
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.
Under inotify (leaving the polling backend unchanged), tail now also watches the followed file across rotations (ignoring errors when adding the file watch, e.g. on unreadable files, since the directory watch still covers them). New tests verify the watched inodes via
/proc/<pid>/fdinfoand thattail -Fkeeps running on unreadable files. The GNU CI run also reportstests/tail/follow-nameandtests/tail/pid-pipeas newly passing.Note:
tests/tail/inotify-rotate-resources.shstill fails: notify runs its inotify syscalls in a background thread, and the test runs strace without-f, so it only traces the main thread. See the comment below.Part of #16650