From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: "supervision@list.skarnet.org" <supervision@list.skarnet.org>
Subject: Re: Scripting Stage 3 and 4
Date: Thu, 09 Jan 2025 23:19:58 +0000 [thread overview]
Message-ID: <ema1d15182-60cf-4c78-8acb-276b3f4ac9ec@5220f6aa.com> (raw)
In-Reply-To: <1dcb4b00-db5d-49bd-8598-fd6b2e5febdd@sopka.ch>
>Now I was wondering why you, Laurent recommend against using the finish script of s6-svscan
>for the shutdown procedure (here: https://skarnet.org/software/s6/s6-svscan-1.html#stage3).
>
>Using that would make good portion of my implementation more elegant and simple
No, it would not, and the link you quoted explains why.
As long as you have things to do, and especially if you have several
processes involved - as you have in an execline script - you want to
keep a real init system as pid 1, not a shell or a random sequence of
executables as would happen with execline. You don't want to leave
zombies around potentially preventing unmounts, you want to be able
to recover and get a shell until the very end, and you don't want your
pid 1 to accidentally get killed. If you leave s6-svscan running, you
have all this for free; if you terminate it and run your shutdown
sequence as its finish script, you need to pay attention to this for
the entirety of stages 3 and 4.
I tried both approaches. Keeping s6-svscan as pid 1 until the very
end was by far the safer, less brittle option. Even if it means you
need to add a little dance to have the supervision tree restart what
you want when you want it and nothing else - the peace of mind it
brings is priceless.
--
Laurent
next prev parent reply other threads:[~2025-01-09 23:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 20:25 Paul Sopka
2025-01-09 23:19 ` Laurent Bercot [this message]
2025-01-11 8:30 ` Paul Sopka
2025-01-11 12:21 ` Re[2]: " Laurent Bercot
2025-01-11 15:15 ` Paul Sopka
2025-01-11 13:22 ` Guillermo
2025-01-11 15:29 ` Paul Sopka
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=ema1d15182-60cf-4c78-8acb-276b3f4ac9ec@5220f6aa.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).