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.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,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 1E6FB2DB8F for ; Thu, 19 Sep 2024 05:33:25 +0200 (CEST) Received: (qmail 41111 invoked by uid 89); 19 Sep 2024 03:33:51 -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 41104 invoked from network); 19 Sep 2024 03:33:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1726716797; x=1727321597; i=janbraun@gmx.de; bh=ZhMX6AJzV0nadPUWvEVsnN1Sk+B9ypm3vrfqLoqJxag=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=EMZhECQRM6plEoIG1oWj3dJ6+ZlbvGnk616+llFJk+pni1tM0D0+in12bkPVb4R+ eLe+nouz9QSfZ72jqmiHIzKYSmFb3rbJWJgOc9+Mt09PnC7xUKzH8O+B1v8YxJ1bK 2dSVZfxfQcKrbUmh8zSNkIgAf18+RP9bQMOX5lu5Z3U055T1Imv02MpeNaICR8OfS PNyRtxVtBsYkFs/rxYNZDomu6RuZOviRIPTrUziT0U1k22zVVvoEPsDqOluLGyJPp B968JsGjRLooQyiFXItgdT+MMlP9JCeOtGu9C6zv6BTeUmeyteiVC0GnMzQG/fEUO fZ8XUR3a5EZCDubQyA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Date: Thu, 19 Sep 2024 05:33:16 +0200 From: Jan Braun To: Paul Sopka Cc: supervision@list.skarnet.org Subject: Re: s6/s6-rc policy for Gentoo: config files for service scripts Message-ID: Mail-Followup-To: Paul Sopka , supervision@list.skarnet.org References: <442f0112-3120-4609-8a87-c4d9f7119868@sopka.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="uVYDO00m1x9dK5Gn" Content-Disposition: inline In-Reply-To: <442f0112-3120-4609-8a87-c4d9f7119868@sopka.ch> X-GPG-Fingerprint: 1736 D50F 170B 70A6 9223 BC15 295E 703E 6D1D 2FCF X-GPG-Encryption-Welcome: always X-Provags-ID: V03:K1:5xymAoE/i7qZw6RE+BtR5AlVsKVqvDdrzPhT/nzZJPmIGuLMThc WhgIQ3URpfVcKmQQMVtFN0mW8reoHhYdRfXF1nd10ry8jKahhFIJ+fZbsszkgEKWPKU4vXg ThuHoO4fep0+t5c8uM5nZN3/g0Vk00bn3vl54j87X9sT+1JFzO8ke5S5UPpWzKNKpEpVIus FioNblaI+gfP/WgV6nIaA== UI-OutboundReport: notjunk:1;M01:P0:+nGYVa7HfGE=;zX7TzU0HrsTJlCPkMtNoSx3Uii+ 2Eq8Ko22LExZTi/Ej/Duam97IZ/dyxmxaWwVRlIEgtaUgp9ZHbPR0P1ZLry2mN1A56R6IvHcS nUEC+e/pNMRSr1f6yjqy+Of+4+OqinC5XxbAHF/46GDzD4Z4AV5WbBOCbOdJEV7f/bgx9i02W lpOe3fgmewy1uvfArFf1thEak3TnDzk913W05+7O+QgI8oSRXhNoc0troW+9OzD174T1f9eHx x01V8+JXn7wzQirek3k7QiR+uyzLWqjos5jePxNlL7JyyL/jp6x7y0dtt9OVrSl+E7ZhMnY2r lFOr1oVt84aW22hmUqaHDvi6cOnPFUgcq+3u9bb5uTNIdYmHd9PYJpwhP855kyBWdsTXDhwAq A3VNlWrSaUdo/Y2npu4SOitm6NpkoeZaqPeoy05YsNAhdktp5JUve1kzglAN8BrSoxgIXnQBC I3J6W4FFu4x2pfWUwGY7MaSiFh1WbxjNcNl6yRSSErrMYcgj6/JafMxLn9FglSAXPyn5WWwhY gyYS08V6ILKXySpRASw2cvEOeFrOcljlSs7x9Tyi+hPPhEApGNHsf2FRRi9Odi8ZXnXaoih5s WdA+qNtn+GJbkz5ywnXudT3q5weAdExPb9iThhAzBo1lAuWwbahV7+JrOWLfGc0n1xSS11pWb 3kJv5RxW2EGXv/KYlbmxToyPITaCiqq9HZ9FtXUg0zAhqL0P0hiGZB9w0/NOVIAU9aCp63oPK 7I50utQoLAHt/SuuNZdEQnhRsAoF9EPy/iIB6RJThOl39ACgTNZhSeALjGhnxfcljU3KX/tAi F8U4EpP+s3jn4hAnLBL/G24A== --uVYDO00m1x9dK5Gn Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Paul Sopka schrob: > - The sysadmin or the user can copy a skeleton from > /etc/s6-rc/skel/{config,src} (which is populated by the package > manager with configs and initial bundles) to ${HOME}/.config/s6-rc/, > this folder shall be used for configuration and custom user services. A skeleton is not config data, and should thus be in /usr/ Possibly /usr/.../examples/... > - The package manager puts service source directories and an initial > set of bundles for system services to > /etc/s6-rc/system/src/{services,bundles}. >=20 > - The package manager puts service source directories and an initial > set of bundles for both user and system services to > /usr/share/s6-rc/{user,system} as a reference of the defaults. If you put defaults in /usr, then prefer symlinking them into /etc, rather than creating a copy. That'll automatically handle changing defaults, and make it obvious what is locally customized. > - The idea of config files is completely dropped and the "editing the > config" part is shifted to "editing the run-script" > [...] > Do you suggest any alterations or even a completely different approach? Void has a nice idiom in their run scripts: | #!/bin/sh | exec 2>&1 | [ -r conf ] && . ./conf | exec acpid -f ${OPTS:=3D-l} That achieves 3 things: 1) It works out of the box (without a conf file). 2) The user can create a conf file containing OPTS=3D'-l -d -S' to customize the daemon options. 3) The user can create a conf file containing if [ $((`date +%s` % 100)) -eq 0 ] ; then poweroff ; fi exec /usr/local/bin/notreallyacpid --foo to completely=B9 override the run file. Note how the KEY=3Dvalue pair in 2) is actually shell, hopefully eliminating any worries about config file format. HTH, Jan =B9) The "exec 2>&1" is an artifact of how runit does logging, and should always be done. Hence it comes before the conf entry point. If there was a valid use for stderr, lines 2 and 3 could be switched, of course. --uVYDO00m1x9dK5Gn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEFzbVDxcLcKaSI7wVKV5wPm0dL88FAmbrm3YACgkQKV5wPm0d L8/6Hw/5AQ7IGiCQHQw2wHCV+yqYW78RpBso5ZSzk4QZAoIE95xlqnEDsRCE0V+k E42V2So3nEIbqax3xmS/9QmdE+qGjde6Z0TUo/s8DzXDQxQZlfA+qA5gPpeheA6W YAHXMKH4igDjfNp88imselHcBTUXRao5zEg6PzGSGXXm5d26DoKMdHQk1V9gcly2 7ClTa1fac0UFUeWFmdttQ17Bd1MaYAQ30GuM4/Ma59xXTu6ytbPzgaZqe1ZKVcRu rJe/yiYkZDQh8m+kRFWq1xX9KPXpZ3uuTOFmoGmNAruvo4I5DhrwPoNgY2i0NM8/ MVv1526AOjwySKLIYWQsKoX/SZVHyuAz7FBEVW9dHCgqmRFXQNivVFI8wCEXv1LB yLfDmNEdOz/DDmAeUmOdibBWtOgAD4eHEOtJ2DokkxSXF9+cfwEyah8+aCVA8Qch lPyT5hc8HW/oIR0dkmF5IpuRGz9YwWsDUbrBrqeEmQxDmowOW4Rf2UatLCiNSwB7 zQ96e97k/odh37PPM7KpKDxl2+K3idCt/KH5uw1w0Cjk4rnhY1r14M+Q9KExWIKS 9KPS14XAK4sTDHK4Zp1lzwecRhDKYI3MQxZCwtv4pMKKLs4WKrYMVLV3wBiVBCWj 7/v/2k5TY0YgINluaIjmJcU9ZpPTjJmCs1TQBXCo7GDUCkVaDGg= =0L5l -----END PGP SIGNATURE----- --uVYDO00m1x9dK5Gn--