bin/54492: tail -F duplicates lines
cperciva at daemonology.net
Tue Jul 15 00:10:19 PDT 2003
>Synopsis: tail -F duplicates lines
>Arrival-Date: Tue Jul 15 00:10:17 PDT 2003
>Originator: Colin Percival
>Release: FreeBSD 4.7-SECURITY
tail -F sometimes duplicates lines after the first rotation.
cperciva at beastie$ rm foo && touch foo && ( for x in 1 2 3 4 5; do echo
hello $x > foo && sleep 2 && echo world $x >> foo;done & tail -F foo )
hello 2 # this line shouldn't be here
hello 3 # this line shouldn't be here
hello 4 # this line shouldn't be here
hello 5 # this line shouldn't be here
I've also observed this when using `tail -F` on Apache logfiles (again,
after the file has been rotated once; when that happens, it prints out
all the lines in the file again, as if the file had been rotated).
Based on the symptoms, I'd say it looks like a bug in either the
rotation-detection or the truncation-detection code; but I'm not familiar
enough with kqueue to say any more than that.
More information about the freebsd-bugs