From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "Paul Sopka" <psopka@sopka.ch>, supervision@list.skarnet.org
Subject: Re[2]: Have s6-svscan send SIGTERM to one logger
Date: Tue, 03 Dec 2024 00:56:31 +0000 [thread overview]
Message-ID: <em6f2cdbd0-9efc-4b2f-9473-3f17c5bbd754@1e890941.com> (raw)
In-Reply-To: <66b93398-3f98-4b6c-b3f2-d91054e727fe@sopka.ch>
>This is what I did before, but in an effort to make the "sub-supervision-tree"
>independent of whatever init-system/service manager is used for the main tree,
>I tried what I described.
Well, it's not very satisfying, but I understand the wish, so here
is how I do it on Alpine Linux. You can take inspiration from it:
https://gitlab.alpinelinux.org/alpine/aports/-/raw/master/main/s6/s6-svscanboot
This is invoked by openrc in order to start a new supervision tree.
OpenRC doesn't provide any native logging infrastructure, so the
script creates its own catch-all logger. The fd dance is similar to
what s6-linux-init does. Killing s6-svscan *should* also make the
catch-all logger die on its own. (It was buggy in previous versions,
but with the current version of s6, it should work).
Note that /dev/console is explicitly mentioned towards the end,
because openrc doesn't provide an open fd to it to its services. If
you want your script to be portable to any service manager, you should
probably do the same. Else, you could try saving the script's stderr
instead, and making it s6-svscan's console holder, but that requires
a little more fd dancing, and that won't work with OpenRC or other
service managers that don't give you a suitable stderr fallthrough.
--
Laurent
prev parent reply other threads:[~2024-12-03 0:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 17:35 Paul Sopka
2024-12-02 19:37 ` Laurent Bercot
2024-12-02 21:05 ` Paul Sopka
2024-12-03 0:56 ` Laurent Bercot [this message]
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=em6f2cdbd0-9efc-4b2f-9473-3f17c5bbd754@1e890941.com \
--to=ska-supervision@skarnet.org \
--cc=psopka@sopka.ch \
--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).