supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Paul Sopka <psopka@sopka.ch>
To: supervision@list.skarnet.org,
	Laurent Bercot <ska-supervision@skarnet.org>
Subject: Re: Scripting Stage 3 and 4
Date: Sat, 11 Jan 2025 09:30:28 +0100	[thread overview]
Message-ID: <9ec5e5f1-35f9-4e6b-abd0-79299779b515@sopka.ch> (raw)
In-Reply-To: <ema1d15182-60cf-4c78-8acb-276b3f4ac9ec@5220f6aa.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1641 bytes --]

Thanks for the answer, I understand it better now.
To be honest I had to get a little bit used to this unconventional way 
of shutting down.

I found these arguments a little weak:

> 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
Since you can get a shell easily in the finish script too:

| if -n { mount -o remount,ro / }
| sh

And accidentally killing PID 1 would break the supervision tree based 
approach too, right?

But getting a more advanced recovery method up,
e.g. an ssh server when you only have remote access
or an agetty instead of PID 1 sh on a desktop machine,
will be more reliable under a supervision tree, I can see that.

Further, I was wondering about how to implement such a fallback, would:

| if -n { mount -o remount,ro / }
| foreground { s6-svc -U /run/service/recovery }

(With what "recovery" is being a decision of the sysadmin)
Something like this hold up well enough?

One could also argue that the finish script of s6-svscan is really a 
last resort and,
if something can be implemented well in another way (as is the case here),
it should be.

Anyhow, you have convinced me that keeping the supervision tree is the 
better way.

Finally, if there is anything that could fundamentally be done better in 
the script,
please tell me. This is to everybody here, I am happy about every 
GNU'ism or util-linux'ism
pointed out in any of the scripts I post,
as I try to make all my scripts work with pure POSIX + ( ubase | toybox 
| busybox ).

I wish you all a nice weekend,

Paul


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3195 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2025-01-11  8:30 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
2025-01-11  8:30   ` Paul Sopka [this message]
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=9ec5e5f1-35f9-4e6b-abd0-79299779b515@sopka.ch \
    --to=psopka@sopka.ch \
    --cc=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).