Hi, I am using svlogd for logging and tail -F current to follow on them. I noticed that sometimes I would miss some lines that were added to the files immediately before they were renamed. I looked into the code and noticed that (when FOLLOW_RETRY is true) after sleeping tail immediately checks if the file was replaced (the inode changed) before it tries to read and print the remaining bytes. As far as I understand it this means that if the old file was appended to and the renamed it would miss this information. Have anyone noticed it before? I probably should write a test case for this and think about a patch but I would like to hear a second opinion on this first.
Hi, Yes, this is a problem. It basically renders the FOLLOW_RETRY option useless, and subtly useless at that, because following rotated logs is the main purpose of the option. The file shall be read to the end between checking the inode equality and reopening it.