Re: s6-rc how to log oneshot services

From: Laurent Bercot <ska-supervision_at_skarnet.org>
Date: Tue, 07 Mar 2023 15:06:54 +0000

  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
Received on Tue Mar 07 2023 - 16:06:54 CET

This archive was generated by hypermail 2.4.0 : Tue Mar 07 2023 - 16:07:25 CET