Re: A program that can get exactly the log of a supervised process?

2023-06-22 Thread Casper Ti. Vector
On Fri, Jun 23, 2023 at 03:39:39AM +0800, Casper Ti. Vector wrote: > + if (!argv[0] || !argv[argc1 + 1]) strerr_dief1x (100, "empty program"); >argv[argc1] = 0; Well, these two lines should be swapped. Sorry for the spam :( -- My current OpenPGP key: RSA4096/0x227E8CAAB7AA186C (expires:

Re: A program that can get exactly the log of a supervised process?

2023-06-22 Thread Casper Ti. Vector
On Fri, Jun 23, 2023 at 01:44:19AM +0800, Casper Ti. Vector wrote: > The source code of the program, logtee (licence: CC0), is available at: > Sorry, patch (the first hunk is cosmetic): --- logtee.c

Re: A program that can get exactly the log of a supervised process?

2023-06-22 Thread Casper Ti. Vector
On Sun, Oct 24, 2021 at 12:03:01AM +0800, Casper Ti. Vector wrote: > Any idea on how the log "teeing" may be done cleanly (and portably > if possible; something akin to `tail -f' seems unsuitable because of > potential log rotation), and perhaps any flaw or redundancy in the > design above? The

Re: A program that can get exactly the log of a supervised process?

2021-10-25 Thread Casper Ti. Vector
On Mon, Oct 25, 2021 at 12:37:41PM +, Laurent Bercot wrote: > Another question is how to piggyback loggrep into the notification > mechanism: if loggrep is tied to the logger and not to the service, > it doesn't have native access to the notification pipe. That means a > specific mechanism is

Re: A program that can get exactly the log of a supervised process?

2021-10-25 Thread Laurent Bercot
Why not have the grepper listen on the log file directly? You'll need to have a timestamp in the log and know where the log is, but those can be known at the time of writing the service script. There's no such thing as "the log file". There's the log backendS, which can be one or more

Re: A program that can get exactly the log of a supervised process?

2021-10-25 Thread Rio Liu
Why not have the grepper listen on the log file directly? You'll need to have a timestamp in the log and know where the log is, but those can be known at the time of writing the service script. 原始郵件 在 2021年10月25日 08:37, Laurent Bercot 寫道: >>Well, I do realise the lifespan issue

Re: A program that can get exactly the log of a supervised process?

2021-10-25 Thread Laurent Bercot
Well, I do realise the lifespan issue of the loggrep program, which is why I asked the question in the first place. But I really never thought of directly inserting loggrep into the logging chain as a new node; instead, what I have thought is making loggrep a program "attachable" to the logger.

Re: A program that can get exactly the log of a supervised process?

2021-10-24 Thread Casper Ti. Vector
On Sun, Oct 24, 2021 at 06:20:53AM +, Laurent Bercot wrote: > So basically, either loggrep is a simple tee-like program but you > weaken the supervision properties of the service, or the functionality > needs to be embedded in the supervision architecture, with loggrep > being a consumer for

Re: A program that can get exactly the log of a supervised process?

2021-10-24 Thread Laurent Bercot
Any idea on how the log "teeing" may be done cleanly (and portably if possible; something akin to `tail -f' seems unsuitable because of potential log rotation), and perhaps any flaw or redundancy in the design above? The obstacle I have always bumped against when trying to do similar things is