Re: s6 vs shell wrappers for client connections

From: Steve Litt <slitt_at_troubleshooters.com>
Date: Wed, 11 Jan 2023 15:15:03 -0500

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
Received on Wed Jan 11 2023 - 21:15:03 CET

This archive was generated by hypermail 2.4.0 : Wed Jan 11 2023 - 21:15:37 CET