Re: Working on shell for perp/s6/etc., need advice re logging

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Wed, 29 Jul 2015 02:42:08 +0200

On 28/07/2015 17:58, Colin Booth wrote:
> Assuming you're on linux and the output
> file descriptor is stable, "the right way" is to use procfs to
> directly read against the file descriptor that the logger is
> outputting to. I don't know which file descriptors tinylog uses but
> s6-log uses fd 4 for its file.

  I'll +1 Wayne: this is in no way guaranteed. It's only true for
s6-log if there's only one logdir, and up to the first rotation. It
changes for every rotation - often, but not always, oscillating
between 4 and 6.

  If you want to go the "map the current log file" route instead of
the "insert hooks somewhere in the log flow" one, grepping all the
links in /proc/$loggerpid/fd for /current$ sounds like a better
solution - and even then it's still hackish.

-- 
  Laurent
Received on Wed Jul 29 2015 - 00:42:08 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC