Add a tail_until_writer_finished script.

This is useful for tailing Apache logs in a rigorous way. We don't want
to use 'tail -f' because it never terminates, even if the writer closes
the file. However, we can't just repeatedly reopen and read the file
without risking losing messages during log rotation. This script uses
inotify to detect when a writer to the tailed file closes the file.

TEST=unit tests

Change-Id: I5b060b38e8c3ec316ff6f467b317f895cbf5c394
Commit-Ready: Paul Hobbs <>
Tested-by: Paul Hobbs <>
Reviewed-by: Dan Shi <>
2 files changed