supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Guillermo <gdiazhartusch@gmail.com>
To: Supervision <supervision@list.skarnet.org>
Subject: Re: Dependencies in S6
Date: Wed, 21 Oct 2020 10:17:38 -0300
Message-ID: <CADQ2Nw82_QsKz84BYxz+XWHPTBQew49ntpEC7ACNnUA_V2DDxA@mail.gmail.com> (raw)
In-Reply-To: <CADYBkpEsEC7W-kv+pS4RizYXu1mkC2TdHYYN=DH6=ZDMhWnjTA@mail.gmail.com>

El mié., 21 oct. 2020 a las 7:10, Amaresh Kotekal escribió:
>
> Secnario 1:
> 1. A & B are one shot services in a s6-rc bundle. Service B is dependent on
> A. ( added in dependency file).
> 2. I think Service B will start after the completion of service A ( A then
> B, in serial manner ) is it correct ? or
> 3. Service B will start immediately after the service A as started (in a
> parallel manner) ?

#2. If A starts successfully, B will be started after A, i.e.
serially. If A fails to start, B won't be started.at all.

> Secnario 2:
> 1. A is one shot service and B is a long run service. Service B is
> dependent on Service A.

Same as scenario #1. Whether B is a longrun or a oneshot does not
change the behaviour.

> Secnario 3:
> 1. A is a long run service and B is a one shot service. Service B is
> dependent on Service A.
> [...]
> 3. Do I need to use notification mechanism if I want to start service B
> after A service as reached particular point in execution

Same as scenario #1, service type does not affect the behaviour. What
does depend on service type is the way s6-rc detects that state
transition has completed, and the way it detects transition failure.
For oneshots, transition completion happens when the oneshot's process
terminates. And transition failure is determined based on the process'
exit code, and, if a timeout was specified with a 'timeout-up' file,
also on whether it terminates before the timeout.

For longruns that support readiness notification, transition
completion happens when the longrun's process notifies readiness. And
if a timeout was specified with a 'timeout-up' file, transition
failure is determined based on whether notification happens before the
timeout.

If there is no support for readiness notification, transition
completion happens when the longrun's process has been spawned by its
corresponding s6-supervise process, because there is no better way. If
the process can be polled for readiness, you can use the
s6-notifyoncheck program to hook to s6-supervise's readiness
notification mechanism.

* http://www.skarnet.org/software/s6/s6-notifyoncheck.html

> Secnario 4:
> 1. A & B both are long run services. Service B is dependent on Service A.

Left as an excercise :)

G.

  reply	other threads:[~2020-10-21 13:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 10:10 Amaresh Kotekal
2020-10-21 13:17 ` Guillermo [this message]
2020-10-21 13:23 ` Crest
2020-10-21 13:26 ` Laurent Bercot
2020-10-21 19:14   ` Steve Litt

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=CADQ2Nw82_QsKz84BYxz+XWHPTBQew49ntpEC7ACNnUA_V2DDxA@mail.gmail.com \
    --to=gdiazhartusch@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

supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/supervision

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 supervision supervision/ http://inbox.vuxu.org/supervision \
		subscribe@list.skarnet.org
	public-inbox-index supervision

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.supervision.general


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git