Proposal: Add --watch-pid flag, allow monitoring existing process and existing if it stops or does not exist
Summary
There is an drawback to the existing usage of this binary, or other log monitoring / tailing facilities, in that if a container calls wait
without a specific PID argument to the most appropriate service process, the container could wait for this process to stop.
A direct way to address this is to add a --watch-pid
flag which would result in the termination of this process in the event that said PID terminates. This would eliminate the need for any such call to wait
, and allow the container to stop if the daemon has ended, but logging remains. If this logging process were to terminate abnormally (see gitlab-org/charts/gitlab#2497), it could be restarted based on exit code, without disturbing the daemon.