supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: supervision@list.skarnet.org
Subject: Re: Disconnect between s6-svscan and s6-rc
Date: Tue, 25 Oct 2022 09:29:54 +0000	[thread overview]
Message-ID: <em037c42e5-9bc7-42a4-b29b-a44ddc7a0cfc@21ffc7a5.com> (raw)
In-Reply-To: <20221024233412.4pcy3baje2ly6lsr@localhost>


>The user of s6-rc gets no error message, and waits forever.
>The error message is captured by s6-svscan (or a corresponding logger
>for that service) and is either saved into a log file, or printed to a
>tty on which svscan is running.
>The user is almost never on the same tty with svscan. The user never
>gets an error message from the service, unless they explicitly know
>where to look.

  There's no "tty on which svscan is running". s6-svscan should not
run in a terminal. You *can* do it, but it's fragile: it means your
whole supervision tree is vulnerable to a ^C in a terminal.
  The output of s6-svscan, and the supervision tree by default, should
go to a catch-all logger and potentially to the system console.


>It would be nice if a user can get a temporary view into the service's
>stdout for the short duration of s6-rc execution? Such that when s6-rc
>never exits waiting we can see what the error message that service
>prints?

  For oneshots, it is the case: the output of oneshots will go to the
output of s6-rc.
  Unfortunately, for longruns, that's pretty difficult. One of the
points of supervised longruns is that they're always started with the
exact same environment, and that includes their descriptors. That means
they're outputting to the same place whether or not s6-rc is running.
In order to temporarily display error messages from longruns, s6-rc
would have to find out where the catch-all logger is, and display it
to the user while it's running. That's impossible while s6-rc is
independent from s6 policy.

  Unified policy for better interaction between tools in the toolset is
one of the goals for s6-rc v1, which is still a long ways away.

  For now, my advice would be to always use a timeout when running s6-rc
(you will have an error message if it times out), and/or to have the
supervision tree's output on the system console, and have the reflex to
check the console when you feel that s6-rc is taking more time than it
should. Sorry I don't have any better immediate solution.

--
  Laurent


      reply	other threads:[~2022-10-25  9:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-24 23:34 Ihor Antonov
2022-10-25  9:29 ` 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=em037c42e5-9bc7-42a4-b29b-a44ddc7a0cfc@21ffc7a5.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).