From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from alyss.skarnet.org (alyss.skarnet.org [95.142.172.232]) by inbox.vuxu.org (Postfix) with SMTP id 940122011B for ; Tue, 2 Apr 2024 12:44:21 +0200 (CEST) Received: (qmail 45873 invoked by uid 89); 2 Apr 2024 10:44:46 -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 45859 invoked from network); 2 Apr 2024 10:44:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1712054657; bh=PyKFRZ8BVV13+tmbtQEzoKddrnD34y0Lk0y75OancS0=; h=Date:From:To:Subject:References:In-Reply-To:From; b=czbcU431xcvz6l23zabZhfXhlmlreqewCMa9+EUso5n5ZkVoxBJEBTrkERMoj/7uU crO4Ue2n+g4b1v1p+zmwPexCPA9Q98qg26gBQGa3NX93p2a8esBAZ6bA20PLbWvyjo Cq1FVwHEB1YcvHucLxakIzNul+hD4PhgYbSCC/fg= X-Riseup-User-ID: 4C28CA9306DCC6ACF82F47D7DACAF88FB3229120CC8F4B63C90BA10C6CA5FEE5 Date: Tue, 2 Apr 2024 12:44:10 +0200 From: =?iso-8859-1?Q?Ho=EBl_B=E9zier?= To: supervision , skaware Subject: Re: s6-rc user services on Gentoo Message-ID: References: <87jzlgnzoh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="F6tMZ3nC/xBfaWC7" Content-Disposition: inline In-Reply-To: <87jzlgnzoh.fsf@gmail.com> --F6tMZ3nC/xBfaWC7 Content-Type: text/plain; charset=utf-8; protected-headers=v1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Date: Tue, 2 Apr 2024 12:44:10 +0200 From: =?iso-8859-1?Q?Ho=EBl_B=E9zier?= To: supervision , skaware Subject: Re: s6-rc user services on Gentoo Hi, (resending this to the list as I only replied to Alexis, sorry Alexis for t= he=20 double send.) Am Tue, Apr 02, 2024 at 03:42:06PM +1100 schrieb Alexis: > >Hi all, > >Laurent has suggested i ask on IRC about this, but since (a) i'm >in UTC+10, (b) i'm constantly moving between a few different >networks, and (c) my bouncer is currently out of action (it's a >Story), i thought i'd ask on these lists instead, to facilitate >asynchronous replies. :-) I feel you. IRC without bouncer is not always great for getting help on som= e=20 topics. ^^=E2=80=99 > [snip] > >i've had a lot on my plate for a while, but in more recent times >i've had a bit more space to faff around with lower-priority >stuff, and so i'm exploring setting up s6-rc to manage the user >services i need. Once i've done so, i can: > >* write a guide on the Gentoo wiki[a]; and > >* provide service definitions for others to use via my personal > overlay[b]. > >which might help more people to become familiar with the s6 >ecosystem in general, and with s6-rc in particular (rather than >trying to use s6 for service management as well as supervision). Are you planning on having your user services supervisor itself supervised?= And=20 if so, by OpenRC or another instance of s6-svscan? Just asking out of=20 curiosity. >However, i've reached an impasse, and i'm hoping some can tell me >what i'm missing / what i'm doing wrong / what i'm >misunderstanding. > > [snip] > >* SCANDIR=3D"${XDG_DATA_HOME}/s6-rc/services" > >* The above directory contains symlinks to > > ${S6RC_SERVICE_REPO}/{dbus-session-bus,dbus-session-bus-log} > >* S6RC_COMPILED=3D"${XDG_STATE_HOME}/s6-rc/compiled" > >* Running: > > s6-rc-compile "${S6RC_COMPILED}" "${SCANDIR}" > > completes successfully. > >* Running > > s6-svscan -- "${SCANDIR}" > > succeeds, with two s6-supervise processes created. > >* HOWEVER, running > > s6-rc-init -c "${S6RC_COMPILED}" -l "${XDG_RUNTIME_DIR}/s6-rc" > "${SCANDIR}" > > fails, with the error message: > > unable to supervise service directories in > /run/user/1000/s6-rc/servicedirs: File exists Your scandir and your service definitions are the same directory, which the= y=20 should not be. You currently have: * service_definitions=3D"${xdg_data_home}/s6-rc/services" * compiled_services=3D"${xdg_state_home}/s6-rc/compiled" * scandir=3D"${xdg_data_home}/s6-rc/services" * livedir=3D"${xdg_runtime_dir}/s6-rc" However service definitions can not be used as a scandir: if your services = are=20 to be managed by s6-rc they should not be present at start in your scandir = but=20 should be added there by s6-rc-init. That=E2=80=99s why s6-rc-init complains about files already existing: it tr= ies to=20 create a symlink in the scandir pointing to the services it=E2=80=99s manag= ing but it=20 can=E2=80=99t because the service are already present in the scandir. Moreover, had you had any oneshots in your service definition directory, I= =20 think s6-svscan would have simply failed to start, or complained about=20 directories containing no service (oneshots are not supervised by s6-svscan= ,=20 because there=E2=80=99s nothing to supervise in them, so it doesn=E2=80=99t= know about them). What you should have is: * service_definitions=3D"${xdg_data_home}/s6-rc/services" * compiled_services=3D"${xdg_state_home}/s6-rc/compiled" * scandir=3D"${xdg_runtime_dir}/services" * livedir=3D"${xdg_runtime_dir}/s6-rc" Your scandir should be in your runtime dir because it does not contain data= but=20 the current running configuration of your system. It can be an empty direct= ory=20 when you start s6-svscan, there is nothing wrong with that. s6-rc will popu= late=20 it according to the compiled services you feed him. >i've taken a look at s6rc_livedir_create.c: > > https://git.skarnet.org/cgi-bin/cgit.cgi/s6-rc/tree/src/libs6rc/s6rc_liv= edir_create.c > >but nothing is leaping out to me as explaining what's happening. > >Thoughts? > > >Alexis. > >[a] The current s6 and s6-rc pages on the wiki have lot of detail, >without any "quickstart" tutorials that might make it easy for >people to get on board. A while ago i did a big restructure of the >s6 article: > > https://wiki.gentoo.org/wiki/User:Flexibeast/drafts/S6 > >which i feel improves the current page: > > https://wiki.gentoo.org/wiki/S6 > >but which has been awaiting review by a more senior wiki editor >than me. > >The s6-rc page is similarly detailed and similarly lacking a >"quickstart": > > https://wiki.gentoo.org/wiki/S6-rc Yeah, these definitely don=E2=80=99t help as much as they should, it=E2=80= =99s a good thing=20 someone decides on improving them, thanks for that. :) >[b] Various people are providing s6 service definitions, >e.g. https://codeberg.org/alecStewart1/gentoo-s6-scripts, but i'm >not >currently aware of any providing s6-rc service definitions - >pointers welcome. :-) You can see my own outdated s6-rc system service definitions at: * https://forge.dotslashplay.it/s6-rc/system-services and my (also outdated) s6-rc user tree service definitions at: * https://forge.dotslashplay.it/s6-rc/personal-services Ho=C3=ABl --F6tMZ3nC/xBfaWC7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEElZjiR4iQkYjVEGdt6jPCPrF3Nk0FAmYL4XoACgkQ6jPCPrF3 Nk1yuRAAjqEWo85pzbfv7088IiNIsLjcDnpYUbUMKrgS03YMIJrQF2Xq/uS3WyEV cpyeNsRtXV+KLvBnROboYWBrMKJOOcYqdjOeJqM7rA2e2eoR7Qr/oQmFnXy/+iFS SxQAQMUn7W24IJClOT2l62FCYHV/Z433DOYKRdOthl6fNgyhph2m0dT7/IRHyhEU nshPF4OdzTuyZVxiRiV3hHF5bVwGsf16RoPa21IjJOyfk+eumP301MuNEgWXA2SZ t5klmQ26YFpzLbC7YnP8i8ZadyHGasS8ZG0ZvThQD9K50282gl+A7J8sp+/etKJ3 TfQ5m9ZARcsdCvobjYtpc1gLGjbp83+3S5mnXEVQtKm2/aqNSzYmV0cBquwvANgL O0h1JKWV9uR7dmYRz40h3TqAM3A5Br04+5pYUTaJeXSZWOZ92wjweEcWwPcw6dLX 5pXj8YV0flkrWwL5IFnMQLoqQay9l68g32rMO5u+53OtqBTLmhcRyTuiuFMj7VfE Z7sKllYF+0NpeCXgemijsWufGdSOVsk14GfZyrURL99JyN8+pV4r67VLjskqwWPL u8zAPn5KvnRRHJQ41MGoukemdh9xDaeI6YIif0v+M+PmOR30l9nVftKnhRBzxUp0 WVtbfAUe2fU4QDPjDtmf9Cf0W5e/PIR+0+N30N1XHcnPMjEFC3A= =XchP -----END PGP SIGNATURE----- --F6tMZ3nC/xBfaWC7--