]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: allow multiple PIDs
authorStephen Kitt <skitt@redhat.com>
Mon, 18 Sep 2023 16:09:29 +0000 (18:09 +0200)
committerPádraig Brady <P@draigBrady.com>
Wed, 20 Sep 2023 14:53:34 +0000 (15:53 +0100)
commitd24a117707323c9ccc6ff4ad1e50ecb78aad937e
tree2a61f359daf4b1c231871d28db5e743804f92eed
parent8367b95a13b96b96db93a7339c094f813af877c9
tail: allow multiple PIDs

tail can watch multiple files, but currently only a single writer. It
can be useful to watch files from multiple writers, or even processes
not directly related to the files (e.g. watch log files written by a
server process, for the duration of a test driven by a separate
client).

* src/tail.c (writers_are_dead): New function.
(tail_forever): Use it to wait for writers.
(tail_forever_inotify): As above.
(parse_options): Manage --pid options in an array.
* doc/coreutils.texi: Update documentation.
* tests/tail/pid.sh: Add a variant with two PIDs.
* News: Mention the new feature.
NEWS
doc/coreutils.texi
src/tail.c
tests/tail/pid.sh