supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Steve Litt <slitt@troubleshooters.com>
To: supervision@list.skarnet.org
Subject: Re: s6 vs shell wrappers for client connections
Date: Wed, 11 Jan 2023 15:15:03 -0500	[thread overview]
Message-ID: <20230111151503.2a4bb0c8@mydesk.domain.cxm> (raw)
In-Reply-To: <FxOuWLzQ1B0aKMDSLq5hI3ftZkCJ_ZAmIBnKFLPdY2kV7fvM7YBpcMKu0XLPj5ETWnYjY18VlPTWy7EmMms3n4_P3b4K2D_Dfff3GOhXdn0=@protonmail.com>

artur.brzozowski said on Tue, 10 Jan 2023 22:23:32 +0000

>How, if at all, could s6
>help remove this executable ambiguity, the need for checking and
>wrapping? The goal is to always run the program correctly: if
>server is available, connect to it with client binary, if not -
>use the standard one.

if s6-svstat myserver; then
  client_binary
else
  send_email_to_admin
  faux_client_binary
fi

or:

[ s6-svstat myserver ] && exec client_binary
send_email_to_admin
exec faux_client_library

I guess the preceding scripts qualify as a "wrapper scripts", but
they're pretty innocuous. The second one doesn't even leave a trace
that it was ever a shellscript.

As Laurent mentioned, the s6/runit/Daemontools philosophy is to assume
the server's running because Daemontools-inspired process supervisors
are so robust, but if your client must be available no matter what,
even when the server is deliberately taken down for replacement or
servicing or troubleshooting, then for sure a Plan B is a good thing.

SteveT

Steve Litt 
Autumn 2022 featured book: Thriving in Tough Times
http://www.troubleshooters.com/bookstore/thrive.htm

  parent reply	other threads:[~2023-01-11 20:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 22:23 artur.brzozowski
2023-01-11  9:53 ` Laurent Bercot
2023-01-11 16:08   ` artur.brzozowski
2023-01-11 20:15 ` Steve Litt [this message]
2023-01-12  0:51   ` Laurent Bercot

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=20230111151503.2a4bb0c8@mydesk.domain.cxm \
    --to=slitt@troubleshooters.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).