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: Brett Neumeier <random@freesa.org>, supervision@list.skarnet.org
Subject: Re: Have an external script wait for a oneshot service
Date: Wed, 4 Dec 2024 21:59:06 +0100	[thread overview]
Message-ID: <e4831f21-756a-45b9-a69a-9bff1668a652@sopka.ch> (raw)
In-Reply-To: <20241204141821.ee2a00c996c948f2feb42dec@freesa.org>


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

> Ah, I see: from your external script, you do not want to know*whether* a oneshot service has completed; you want to block*unless or until* it has completed?
>
> In that case, I would use `s6-ftrig-notify` in the oneshot service, and both `s6-rc -a list` and `s6-ftrig-wait` in the external script:
>
> in the oneshot, as the last action taken before quitting, use `s6-ftrig-notify` to send an event to a fifodir;
> in the external script, `s6-rc -a list | grep -q $(oneshot_service_name)` to proceed if the oneshot is already up, and then if it is not up, `s6-ftrig-wait` to block until it is.
>
> Or, as you say, you can use fifodirs directly without the convenience programs that interact with them already.
>
> There might be a race condition there, but that's something you can surely work around if it's a concern.

Exactly!

Although it would be nicer to have a standard way to do this,
consistent with longruns, as described in my initial Mail.

Let's see what Laurent thinks of that.

Thanks and regards

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:[~2024-12-04 20:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-04 15:28 Paul Sopka
2024-12-04 15:38 ` Charles Cazabon via supervision
2024-12-04 17:12   ` Paul Sopka
2024-12-04 21:47     ` Hoël Bézier
2024-12-04 20:00 ` Brett Neumeier via supervision
2024-12-04 20:05   ` Paul Sopka
2024-12-04 20:18     ` Brett Neumeier via supervision
2024-12-04 20:59       ` Paul Sopka [this message]
2024-12-04 21:58         ` Re[2]: " Laurent Bercot
2024-12-05  5:59           ` Tanuj Bagaria
2024-12-05  6:54           ` Paul Sopka
2024-12-05  8:05             ` Re[2]: " Laurent Bercot
2024-12-05 13:52               ` Paul Sopka
2024-12-05 19:44                 ` Re[2]: " Laurent Bercot
2024-12-05 21:10                   ` Paul Sopka
2024-12-05 21:42                     ` Brett Neumeier via supervision
2024-12-06  5:32                       ` Paul Sopka
2024-12-05 23:03                     ` Re[2]: " Laurent Bercot
2024-12-06 12:41                       ` Paul Sopka
2024-12-06 15:43                         ` Re[2]: " Laurent Bercot
2024-12-06 16:11                           ` Hoël Bézier
2024-12-06 17:14                           ` Paul Sopka
2024-12-07 23:46                           ` Jan Braun
2024-12-05 21:24                   ` Jan Braun
2024-12-05 23:15                     ` Re[2]: " Laurent Bercot
2024-12-04 20:09   ` Tanuj Bagaria

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=e4831f21-756a-45b9-a69a-9bff1668a652@sopka.ch \
    --to=psopka@sopka.ch \
    --cc=random@freesa.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).