supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Davor Ocelic <docelic-skarnet@spinlocksolutions.com>
To: supervision@list.skarnet.org
Subject: Re: Pattern for multiple subservices and dynamic discovery i.e. VPN
Date: Thu, 18 Aug 2022 14:18:27 -0400	[thread overview]
Message-ID: <20220818181827.GA15282@hcoop.net> (raw)
In-Reply-To: <20220818143936.439ce5cc@flunder.oschad.de>

On Thu, Aug 18, 2022 at 02:39:36PM +0200, Oliver Schad wrote:

> > - It creates the appropriate service directory for this particular
> >   VPN config (possibly based on a template)
> > - It calls s6-svlink or the like to register the new service, which
> >   automatically also notifies s6-svscan that a new service has been
> >   added
> 
> That would just move 3 components to another level but they are
> still needed: scanning existing service directories, diffing between
> desired and current state and applying - so creating or removing
> directories.

Right. And unfortunately that scanning/comparing of current and desired
states can quickly destroy the elegance of the original idea.

But I believe there is a way to make this work without explicitly scanning
(except for the necessary minimum) and without comparing or keeping internal
state. Various features and behavior details that Laurent already added to
s6 make this very doable.

Please take a look at: https://github.com/docelic/s6-dyn

It is a working demo I put together in the last couple hours to demonstrate
the proposed model.

The README covers a runnable demo / test case. After that, you could
read the comments in `manager/manager.rb` to get a better description of
the design decisions and alternative behaviors that are possible.

(The manager is in Ruby since I saw you using it. It could be any laguage.)

If you, Laurent, or the rest of the list have any comments or suggestions
for improvements, please share. (The manager is slightly customized
to your VPN example, but it can easily be extended and made generic.)

Thanks,
Davor

  parent reply	other threads:[~2022-08-18 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17  8:32 Oliver Schad
2022-08-17 11:04 ` Laurent Bercot
2022-08-18  9:32   ` Oliver Schad
2022-08-18 10:04     ` Davor Ocelic
2022-08-18 12:39       ` Oliver Schad
2022-08-18 16:36         ` Laurent Bercot
2022-08-18 18:18         ` Davor Ocelic [this message]
2022-08-18 11:40     ` 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=20220818181827.GA15282@hcoop.net \
    --to=docelic-skarnet@spinlocksolutions.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).