Re: Pattern for multiple subservices and dynamic discovery i.e. VPN

From: Davor Ocelic <docelic-skarnet_at_spinlocksolutions.com>
Date: Thu, 18 Aug 2022 14:18:27 -0400

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
Received on Thu Aug 18 2022 - 20:18:27 CEST

This archive was generated by hypermail 2.4.0 : Thu Aug 18 2022 - 20:18:58 CEST