GNU’s tail has a command line option for this: “–pid=…“. What a nice feature!!!
I was just about to do implement “it” the usual way, when I came across the manual page and got aware of this feature. Used it, worked as expected. This is great!
I actually needed it first in a Windows context; so I had to convert a .bat script to a Cygwin-style bash script; then I implemented the file watching as described above. I like the UNIX and GNU toolchains.