From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16998 invoked from network); 18 Aug 2022 09:33:32 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 18 Aug 2022 09:33:32 -0000 Received: (qmail 7744 invoked by uid 89); 18 Aug 2022 09:33:56 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 7734 invoked from network); 18 Aug 2022 09:33:56 -0000 Date: Thu, 18 Aug 2022 11:32:30 +0200 From: Oliver Schad To: supervision@list.skarnet.org Cc: "Laurent Bercot" Subject: Re: Pattern for multiple subservices and dynamic discovery i.e. VPN Message-ID: <20220818113230.11f70deb@flunder.oschad.de> In-Reply-To: References: <20220817103258.59b7f3a0@flunder.oschad.de> Organization: Automatic Server AG X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/TapScSw/OIpgyqYEBgEjGqt"; protocol="application/pgp-signature"; micalg=pgp-sha1 --Sig_/TapScSw/OIpgyqYEBgEjGqt Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Dear Laurent, thanks a lot for your quick response. I understand, that dynamic discovery needs some thoughts to implement in an easy and flexible way. Just to understand the requirements, if we want to implement that today: - we need an scanning component for the desired state of running instances (something like 'find /etc/openvpn -name "*conf"') - we need an scanning component for the current state in process list - we need a diffing component - we need a state applier component A component could be a shell function. Applying state would mean to fork and exec. A process tree would look like /usr/bin/s6-svscan s6-supervise vpn-manager vpn-manager openvpn foo1.conf openvpn foo2.conf Best Regards Oli On Wed, 17 Aug 2022 11:04:50 +0000 "Laurent Bercot" wrote: > > > >I'm looking for a pattern to solve a problem, where you have to > >discover dynamically the services you have to start. > > > >Examples could be VPN configurations, where you discover the > >configuration files and start for every file an instance of the VPN > >service. =20 >=20 > Hi Oliver, >=20 > Dynamic instantiation is a real pain point - it's an often requested > feature, but it's surprisingly hard to make it work correctly and > safely in a supervision scheme. Supervision works very well in static > environments, but dynamic discovery is at odds with the architecture. >=20 > I have a few ideas to mitigate that and help people create instanced > services. Instantiation is a planned feature of the future s6-rc v1 > but it's still a ways away; I am also thinking of adding tools to help > people handle instances with regular s6, amd they may come in the near > future, but there are currently no such helpers, sorry. >=20 > -- > Laurent >=20 --=20 Automatic-Server AG =E2=80=A2=E2=80=A2=E2=80=A2=E2=80=A2=E2=80=A2 Oliver Schad Gesch=C3=A4ftsf=C3=BChrer Hardstr. 46 9434 Au | Schweiz www.automatic-server.com | oliver.schad@automatic-server.com Tel: +41 71 511 31 11 | Mobile: +41 76 330 03 47 --Sig_/TapScSw/OIpgyqYEBgEjGqt Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQR7zzwbEv6+GMBe8mxGKXFRS5aW8AUCYv4HLgAKCRBGKXFRS5aW 8LFQAJ0Rspu4x3oi0Ykg070Fx9vjPL0lFQCeLFP+KIpYDKi+0eUP3CODoYLJzNQ= =T7Qg -----END PGP SIGNATURE----- --Sig_/TapScSw/OIpgyqYEBgEjGqt--