From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: supervision@list.skarnet.org
Subject: Re: s6 vs shell wrappers for client connections
Date: Thu, 12 Jan 2023 00:51:24 +0000 [thread overview]
Message-ID: <em59075ad1-888c-42e4-a920-095cf42a1d96@b65474f8.com> (raw)
In-Reply-To: <20230111151503.2a4bb0c8@mydesk.domain.cxm>
>if s6-svstat myserver; then
> client_binary
>else
> send_email_to_admin
> faux_client_binary
>fi
Please don't do this.
- As Steve would be able to tell you if he had read the documentation
page for s6-svstat (https://skarnet.org/software/s6/s6-svstat.html),
"s6-svstat myserver"'s exit code does not mirror whether myserver is
running or not. If myserver is a live service directory, s6-svstat
will print a line to stdout summarizing the status of the service,
then exit 0. Zero, even if the service is down, so client_binary
will fail.
s6-svstat will only exit nonzero if an error occurs or if no
supervisor is running on myserver, which is not what this script
aims to test.
- It is good to notify the admin when something on the system is not
working correctly. Doing it automatically from a script, however, is
not a good idea. Spamming the admin's mailbox via automated messages
is an great way to get yourself ignored at best (which defeats the
purpose of reporting bugs) or banned at worst.
- If you're using s6, as I said earlier, you're supposed to be able
to assume that myserver is running, and you don't have to write
such wrappers, even ones that would work.
--
Laurent
prev parent reply other threads:[~2023-01-12 0:51 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
2023-01-12 0:51 ` Laurent Bercot [this message]
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=em59075ad1-888c-42e4-a920-095cf42a1d96@b65474f8.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).