GNU bug report logs - #74653
tail --follow=name doesn't exit when using inotify and the file is moved

Previous Next

Package: coreutils;

Reported by: Göran Uddeborg <goeran <at> uddeborg.se>

Date: Mon, 2 Dec 2024 16:20:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Göran Uddeborg <goeran <at> uddeborg.se>
To: 74653 <at> debbugs.gnu.org
Subject: bug#74653: tail --follow=name doesn't exit when using inotify and the file is moved
Date: Mon, 2 Dec 2024 17:19:21 +0100
When using "tail --follow=name", but without "--retry", on a file
supporting inotify, the command doesn't finish if the file is moved to
a new name.

Repeat this way on a local filesystem:

    echo apa > apa
    tail --follow=name apa &
    mv apa bepa

"tail" will print an error message saying "No such file or directory",
but it will continue running. I would expect a following message "no
files remaining" and "tail" to exit.

If the file system doesn't support inotify, if "apa" is on NFS for
example, "tail" exits as expected.

If the file is removed rather than moved ("rm apa") "tail" also exits
as expected.

This is tested on Fedora 41 using

coreutils-9.5-11.fc41.x86_64
kernel-6.11.6-300.fc41.x86_64




This bug report was last modified 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.