From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "supervision@list.skarnet.org" <supervision@list.skarnet.org>
Subject: Re: s6-rc how to log oneshot services
Date: Tue, 07 Mar 2023 15:06:54 +0000 [thread overview]
Message-ID: <em5390cdaa-f27b-4354-af72-2f9acab3b57d@51bac70c.com> (raw)
In-Reply-To: <CAO5Uq5TpTOjZHnRvULp6_PWxvmft9jbzUQM-dwzjLODuFbHBiw@mail.gmail.com>
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
next prev parent reply other threads:[~2023-03-07 15:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-07 10:45 Daniel Barlow
2023-03-07 11:53 ` Alex Kiernan
2023-03-07 15:06 ` Laurent Bercot [this message]
2023-03-07 17:17 ` Carlos Eduardo
2023-03-07 19:00 ` Laurent Bercot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=em5390cdaa-f27b-4354-af72-2f9acab3b57d@51bac70c.com \
--to=ska-supervision@skarnet.org \
--cc=supervision@list.skarnet.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).