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: "billa chaitanya" <billachaitanya@gmail.com>,
	supervision@list.skarnet.org
Subject: Re: S6-log
Date: Wed, 04 Nov 2020 17:35:54 +0000	[thread overview]
Message-ID: <em97a66649-70a9-4de1-81af-acf2617b544c@elzian> (raw)
In-Reply-To: <CAH9hU4Lsvocn=Wv+O-_tQLDMCNAnCDnYo=bAZRiqFXamOdG-aA@mail.gmail.com>

>1) does the log service of a corresponding long run service goes down when
>the long run service is made down using some s6 commands? (like s6-rc -d
>change <long run service name>

  No, because as Crest says, a producer foo depends on a consumer 
foo-log,
not the other way around, so bringing up foo also forces foo-log to be
up, but bringing it down does not force foo-log to be down. (Bringing
down foo-log, however, forces foo to be down.)

  s6-rc provides you with a natural solution to this, though: in your
foo-log definition directory, you can define a "pipeline-name" file:
that will automatically create a bundle containing foo and foo-log,
named after the contents of pipeline-name. If you do, for instance:
   echo foo-pipeline > foo-log/pipeline-name
and recompile your database, then
   s6-rc -u change foo-pipeline
will always bring up foo *and* foo-log, and
   s6-rc -d change foo-pipeline
will always bring down foo *and* foo-log.


>2) Shall we use s6-log for one shot services too?

  s6-log is a long-lived process, designed to log the output from
long-lived process. It doesn't really make sense to use a dedicated
logger for a oneshot.

  What s6-rc does is that the output from all your oneshots is sent
to the catch-all logger, i.e. the place where the supervision tree
sends its output by default. If you are using a s6-linux-init
installation, or similar, chances are that this catch-all log is
itself handled by a s6-log process. Check your /run/uncaught-logs
directory.


>3) is there any command-line option we can provide to s6-log for stopping
>the running s6-log?

  To stop a running s6-log process, simply send it a SIGTERM. If the
s6-log process you want to stop is supervised, the command you want
is probably
   s6-svc -d /run/service/foo-log

  Be aware, though, that if you stop a logger without stopping the
corresponding service, funny things can happen when the logging pipe
fills up: depending on how the service is written, it may lose logs,
or it may hang, or it may die. You should probably never have to
stop a logging process without bringing down the entire pipeline that
leads to it.

--
  Laurent


      parent reply	other threads:[~2020-11-04 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04  9:42 S6-log billa chaitanya
2020-11-04 10:11 ` S6-log Crest
2020-11-04 17:35 ` 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=em97a66649-70a9-4de1-81af-acf2617b544c@elzian \
    --to=ska-supervision@skarnet.org \
    --cc=billachaitanya@gmail.com \
    --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).