From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14660 invoked from network); 7 Mar 2023 15:06:57 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 7 Mar 2023 15:06:57 -0000 Received: (qmail 28318 invoked by uid 89); 7 Mar 2023 15:07:21 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 28311 invoked from network); 7 Mar 2023 15:07:21 -0000 From: "Laurent Bercot" To: "supervision@list.skarnet.org" Subject: Re: s6-rc how to log oneshot services Date: Tue, 07 Mar 2023 15:06:54 +0000 Message-Id: In-Reply-To: References: <87edq0suut.fsf@telent.net> Reply-To: "Laurent Bercot" User-Agent: eM_Client/9.2.1577.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable The default stderr for oneshot services is the default stderr of the supervision tree you're running s6-rc with. So, if you're using s6-linux-init, stderr for oneshot services goes directly to the catch-all logger and you don't need the redirection. If you want your oneshots to log to a different place, you need to redirect the oneshot's stderr to where you want. Since oneshots are, by definition, only run once, it's generally not necessary to have a logger process for them; you can redirect to a file (but be careful of concurrently running oneshots if you have several oneshots logging to the same file!) You can send these logs to a logger process as well, but you cannot use s6-rc's pipeline feature for that; you'll need to declare a fifo manually, have a longrun service reading from that fifo, and have your oneshot depend on that longrun and redirect its stderr to the fifo. It's probably more trouble than it's worth. -- Laurent