From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 27 Jan 2022 11:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 53580@debbugs.gnu.org X-Debbugs-Original-To: "bug-guix@gnu.org" Reply-To: Attila Lendvai Received: via spool by submit@debbugs.gnu.org id=B.164328319622501 (code B ref -1); Thu, 27 Jan 2022 11:34:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Jan 2022 11:33:16 +0000 Received: from localhost ([127.0.0.1]:54513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nD31g-0005qr-Fu for submit@debbugs.gnu.org; Thu, 27 Jan 2022 06:33:16 -0500 Received: from lists.gnu.org ([209.51.188.17]:37710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nD31b-0005qd-Ah for submit@debbugs.gnu.org; Thu, 27 Jan 2022 06:33:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44000) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nD31T-0006MK-Hq for bug-guix@gnu.org; Thu, 27 Jan 2022 06:33:07 -0500 Received: from mail-4323.proton.ch ([185.70.43.23]:46713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nD31N-00014V-Fg for bug-guix@gnu.org; Thu, 27 Jan 2022 06:33:01 -0500 Date: Thu, 27 Jan 2022 11:32:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1643283140; bh=plhAEVwZEbTc3hxl3yxLk5AxHGnHHeoXKOIgytm6qpg=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc; b=ZAbFienYh96rXjcPwzxiNqQvjHBiEYLvr8sybWstdGQIsbP2w6wO2GrPQ8CrDgCkL igJfMe0zu21Jo0Qlbn5skKCzWRYejGn41HcXBH8qrnjRNSSl6sPY23YrTedXb7N68u rorN7BqqwjCvtTkkosj+uij6f4M4wSyBnG3KTg2Km1LxnGcdebVdeHUqwqn3A9bOfh 2JFB/a0iqSu0SgmAkNk19zyymXUP3sehdX9ILSVwk3g/U7Lhuimofjb2kP6S9CosnR NFQGiVVQsncgaHheGcdXY7Emt7FQsoc5W1U1ZoPsICH8oQ1ERaXeiIo7t2qLos0UQf hbrVgNNJlHlWA== From: Attila Lendvai Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Received-SPF: pass client-ip=185.70.43.23; envelope-from=attila@lendvai.name; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) the systems seems to work fine. Gnome is up, i can log in with my user, and= everything seems to work, except herd. i encounter this broken state every once in a while. IRC logs also mention = this multiple times, but without many insights: https://logs.guix.gnu.org/guix/search?query=3D%2Fvar%2Frun%2Fshepherd%2Fsoc= ket ``` # herd status error: connect: /var/run/shepherd/socket: No such file or directory # ps afxu | grep shepherd root 1 0.0 0.3 160788 43684 ? Sl 11:51 0:00 /gnu/store= /cnfsv9ywaacyafkqdqsv2ry8f01yr7a9-guile-3.0.7/bin/guile --no-auto-compile /= gnu/store/vza48khbaq0fdmcsrn27xj5y5yy76z6l-shepherd-0.8.1/bin/shepherd --co= nfig /gnu/store/q4nd803lxrlkr60s8sx88gvpb6c7lxyd-shepherd.conf # uptime 12:26:44 up 0:34, 2 users, load average: 0.00, 0.01, 0.00 ``` looking at shepherd's code: ``` (define (call-with-server-socket file-name proc) "Call PROC, passing it a listening socket at FILE-NAME and deleting the socket file at FILE-NAME upon exit of PROC. Return the values of PROC." (let ((sock (open-server-socket file-name))) (dynamic-wind noop (lambda () (proc sock)) (lambda () (close sock) (catch-system-error (delete-file file-name)))))) ``` maybe this is caused by some call/cc magic that causes an unwind that delet= es the file, but then continues? -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CAbove all, do not lose your desire to walk: Every day I walk mysel= f into a state of well-being and walk away from every illness; I have walke= d myself into my best thoughts, and I know of no thought so burdensome that= one cannot walk away from it.=E2=80=9D =09=E2=80=94 S=C3=B8ren Kierkegaard (1813=E2=80=931855) From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: (No Subject) References: In-Reply-To: Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 27 Jan 2022 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: "53580@debbugs.gnu.org" <53580@debbugs.gnu.org> Reply-To: Attila Lendvai Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.164328562526547 (code B ref 53580); Thu, 27 Jan 2022 12:14:02 +0000 Received: (at 53580) by debbugs.gnu.org; 27 Jan 2022 12:13:45 +0000 Received: from localhost ([127.0.0.1]:54534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nD3er-0006u7-7z for submit@debbugs.gnu.org; Thu, 27 Jan 2022 07:13:45 -0500 Received: from mail-4317.proton.ch ([185.70.43.17]:58806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nD3el-0006tk-Qc for 53580@debbugs.gnu.org; Thu, 27 Jan 2022 07:13:43 -0500 Date: Thu, 27 Jan 2022 12:13:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1643285612; bh=09Bg+zEMb/bJtfrYNtNieABDuw4pTypxIDFyuwPL2IY=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc; b=X+FOqkzj0CHLZAL7BCoQAXEDKe7P0+lBvMMIqZRoT78Ug2pP4mwcfAPkdgQJDYkX0 T1w+IaxSO8giS/WT7CtBGptqfC7kiHfJ/8+zJjJzn6oly79Y8ZUlih85utfeDswumV kYhTn0XjatvOmnF1H0+KIbRYnQSxPIFfOrKtNbA3b4o5MoBATVFCxURpSrc5WBP664 CnLJIwOHB3vhye+LP4VeAcPFkWoUI4Xh2KETZsYeUMLYy28rGnXZ2RkuXZ8HtWzfK9 kl71l8aWe52OeBRtYBmFfARWodGLLsAXhObELpOucQEiS8pHTyALsfdqv8rtdR32d5 L1/h452IZEiQw== From: Attila Lendvai Message-ID: <64mPNb0u2KM14ObD5EvtwiyzLKVPWLeUoaPyu2PuGOvhqFTVrAdkHMZzxksSNaturHgJG5wz53ZsOa_mnGzUnA44E9kFJj_Zi9QUTdC2g-8=@lendvai.name> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_nlawUfAVVjoQ4FKi9yxoftWEhmpCWK2iKromvKCD0A" X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: i forgot to add that i'm working on a shepherd service, and this may be due to errors in the service's user code, like the start gexp. i forgot to add that i'm working on a shepherd service, and this may be due to errors in the service's user code, like the start gexp. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [185.70.43.17 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) This is a multi-part message in MIME format. --b1_nlawUfAVVjoQ4FKi9yxoftWEhmpCWK2iKromvKCD0A Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 aSBmb3Jnb3QgdG8gYWRkIHRoYXQgaSdtIHdvcmtpbmcgb24gYSBzaGVwaGVyZCBzZXJ2aWNlLCBh bmQgdGhpcyBtYXkgYmUgZHVlIHRvIGVycm9ycyBpbiB0aGUgc2VydmljZSdzIHVzZXIgY29kZSwg bGlrZSB0aGUgc3RhcnQgZ2V4cC4= --b1_nlawUfAVVjoQ4FKi9yxoftWEhmpCWK2iKromvKCD0A Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: base64 PGRpdiBzdHlsZT0iZm9udC1mYW1pbHk6IGFyaWFsOyBmb250LXNpemU6IDE0cHg7Ij48ZGl2IHN0 eWxlPSJmb250LWZhbWlseTogYXJpYWw7IGZvbnQtc2l6ZTogMTRweDsiPmkgZm9yZ290IHRvIGFk ZCB0aGF0IGknbSB3b3JraW5nIG9uIGEgc2hlcGhlcmQgc2VydmljZSwgYW5kIHRoaXMgbWF5IGJl IGR1ZSB0byBlcnJvcnMgaW4gdGhlIHNlcnZpY2UncyB1c2VyIGNvZGUsIGxpa2UgdGhlIHN0YXJ0 IGdleHAuPGJyPjwvZGl2PjxkaXY+PGJyPjwvZGl2PjwvZGl2Pg== --b1_nlawUfAVVjoQ4FKi9yxoftWEhmpCWK2iKromvKCD0A-- From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: (No Subject) Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 01 Feb 2022 11:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: "53580@debbugs.gnu.org" <53580@debbugs.gnu.org> Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.16437136029325 (code B ref 53580); Tue, 01 Feb 2022 11:07:01 +0000 Received: (at 53580) by debbugs.gnu.org; 1 Feb 2022 11:06:42 +0000 Received: from localhost ([127.0.0.1]:41827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEqzi-0002QL-1W for submit@debbugs.gnu.org; Tue, 01 Feb 2022 06:06:42 -0500 Received: from flashner.co.il ([178.62.234.194]:37308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEqzg-0002Q9-JW for 53580@debbugs.gnu.org; Tue, 01 Feb 2022 06:06:41 -0500 Received: from localhost (unknown [31.210.177.79]) by flashner.co.il (Postfix) with ESMTPSA id C8F4940043; Tue, 1 Feb 2022 11:06:34 +0000 (UTC) Date: Tue, 1 Feb 2022 13:06:02 +0200 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Attila Lendvai , "53580@debbugs.gnu.org" <53580@debbugs.gnu.org> References: <64mPNb0u2KM14ObD5EvtwiyzLKVPWLeUoaPyu2PuGOvhqFTVrAdkHMZzxksSNaturHgJG5wz53ZsOa_mnGzUnA44E9kFJj_Zi9QUTdC2g-8=@lendvai.name> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="s6LFaWH9pYZOnG8B" Content-Disposition: inline In-Reply-To: <64mPNb0u2KM14ObD5EvtwiyzLKVPWLeUoaPyu2PuGOvhqFTVrAdkHMZzxksSNaturHgJG5wz53ZsOa_mnGzUnA44E9kFJj_Zi9QUTdC2g-8=@lendvai.name> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Thu, Jan 27, 2022 at 12:13:28PM +0000, Attila Lendvai wrote: > i forgot to add that i'm working on a shepherd service, and this may be due to errors in the service's user code, like the start gexp. Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.0 SLIGHTLY_BAD_SUBJECT Subject contains something slightly spammy -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --s6LFaWH9pYZOnG8B Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 27, 2022 at 12:13:28PM +0000, Attila Lendvai wrote: > i forgot to add that i'm working on a shepherd service, and this may be d= ue to errors in the service's user code, like the start gexp. This is generally when I see this type of error. I normally try to create a minimal VM and launch that when I'm trying out a new service. --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --s6LFaWH9pYZOnG8B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmH5FBoACgkQQarn3Mo9 g1F0BRAAnZ/qsgsIqq23R63SXh7VFQcpWt0vabSbUTn/d7iSpf2g2xn3Yxe4X/P9 HSD5BIvuevxjTsSq3ohP5A+pDnREgrnJtxLVw58ZhDS+h/Wz81h0cF/vxnABbyoL CK85axe4keqtiQM0gBO9/lJni9ZL7k4Lhx/LnpziVM3W7ONHuepaVskUd/Gjh4JC yfju0DHahKTlq3tyi0YveTJV8W3DkN44V88k/F7QJO/cDdi+M8i1/NyjVoeqRXpd pdrrRaFWtt2T+RfLCnjz+buuyrm4byeZYaGzHSUuCILylJDbZGh2m9rq5P0+CY6g 61qgNKmoqhDImOJtMy7E/k/PStqRuSBMQalQZnV0bmKPUc4crFsZScDn08dOgSLZ WJaP7D3C9FQRMhaUmMivTFaPxeXm5X6RF1OdAdDZIewZVtnHyb5FQlqNlPteaQn9 rTp8s2OjRNJR98DowYsrelm1936HsTE30XnEp9FsPA8TFfn3MQnCfqBpVfaCkTfB I7rFW1b1RL4uTNgvpsyBPJu+7c0/1LKqYdCkbWIjsOcseA6QSoxRQ1HupJ/3r2PC vaJrz8csoTwFv8GReHDTkP5HAXTeXvWgEdqW+Re/SsHvimE8Pyyfs2KZfXUUTIfy zh9qxw1xzDhOKNz1+/w9shJimik56Tzz4baM6A83hNHRlTpmw/8= =53Uo -----END PGP SIGNATURE----- --s6LFaWH9pYZOnG8B-- From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 01 Feb 2022 19:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai , 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.16437436921730 (code B ref 53580); Tue, 01 Feb 2022 19:29:01 +0000 Received: (at 53580) by debbugs.gnu.org; 1 Feb 2022 19:28:12 +0000 Received: from localhost ([127.0.0.1]:44165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEyp2-0000Rq-LJ for submit@debbugs.gnu.org; Tue, 01 Feb 2022 14:28:12 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:37366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEyoz-0000Rf-OU for 53580@debbugs.gnu.org; Tue, 01 Feb 2022 14:28:11 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id pvU72600P4UW6Th01vU7qy; Tue, 01 Feb 2022 20:28:07 +0100 Message-ID: <04e30e30595ba96786a78c1dbc1768636b5c71e9.camel@telenet.be> From: Maxime Devos Date: Tue, 01 Feb 2022 19:28:03 +0000 In-Reply-To: References: Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-2NWg3TeNJIm0Gr7eWxHF" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1643743687; bh=ZurJxyG4wDioxpJT4RXgNAL2NKalaToEb7BwREiq8AI=; h=Subject:From:To:Date:In-Reply-To:References; b=cRfE0qQ79zy9xXqzT0JOS922HJdIQDET0cQ1fcKt2iOs1Bz6fJfE0lgrqdYYemyeC wuBM6nCWelWs9+Ovl93bcA0jdOuZiBwKW6MDN2+gLtrcqKCJZ0VtQylmId/UYgQFxZ sNd3MUZaDehJg6DXYNo0XB6TcB3rBgf+/V3yuLDt5d+J0ForbfvKPGkWiEJt2hF59U LYGSVZ+CfkpV4h6KNbQE5BF8249vCNMRaiV9sG9HTLrpaCRmdF9QuU7b6ymlE6Bv57 z5EjcSP0xaP/qhkp22F76f8j2lBREENg/k3nwTxiigdLgfmlXxY7aYzCkXLJ14AHlD 1dA3B26VIiErw== X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-2NWg3TeNJIm0Gr7eWxHF Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attila Lendvai schreef op do 27-01-2022 om 11:32 [+0000]: > (define (call-with-server-socket file-name proc) > =C2=A0 "Call PROC, passing it a listening socket at FILE-NAME and deletin= g the > socket file at FILE-NAME upon exit of PROC.=C2=A0 Return the values of PR= OC." > =C2=A0 (let ((sock (open-server-socket file-name))) > =C2=A0=C2=A0=C2=A0 (dynamic-wind > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 noop > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambda () (proc sock)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (lambda () > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (close sock) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (catch-system-error (delete-fi= le file-name)))))) > ``` >=20 > maybe this is caused by some call/cc magic that causes an unwind that del= etes the file, but then continues? Shepherd doesn't use call/cc anywhere. However, it does use _delimited_ continuations, even though only through let/ec and 'guard'/'catch'/... More generally, call/cc is typically unused in (Guile) Scheme code, and call-with-prompt / abort-to-prompt / shift / reset / % are used instead. My guess what happens: the start code of a shepherd service fails between 'fork' and 'exec', with an exception. The exception isn't caught (or is caught and reraised), so the 'out' guard of the 'dynamic-wind' is entered and the file representing the socket is deleted. If that's indeed the case, it might be a good idea to install some exception handlers in fork+exec-command and friends (including make-forkexec-constructor/container), to make shepherd more robust w.r.t. services failing to start. Greetings, Maxime. --=-2NWg3TeNJIm0Gr7eWxHF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYfmJwxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7n+PAQC9O5RtCoEZ35TnqASgf+c0cYCs z4rE4tnPUcUqOg5SRgEAg7SaXSfBntuGGG63v0n522zgxYXgtG+9nZQOOLgv8Qk= =q4tt -----END PGP SIGNATURE----- --=-2NWg3TeNJIm0Gr7eWxHF-- From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 04 Apr 2022 07:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxime Devos Cc: 53580@debbugs.gnu.org Reply-To: Attila Lendvai Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.164905650919139 (code B ref 53580); Mon, 04 Apr 2022 07:16:02 +0000 Received: (at 53580) by debbugs.gnu.org; 4 Apr 2022 07:15:09 +0000 Received: from localhost ([127.0.0.1]:50361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbGvc-0004yb-UH for submit@debbugs.gnu.org; Mon, 04 Apr 2022 03:15:09 -0400 Received: from mail-4018.proton.ch ([185.70.40.18]:36270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nbGvc-0004yL-5d for 53580@debbugs.gnu.org; Mon, 04 Apr 2022 03:15:08 -0400 Date: Mon, 04 Apr 2022 07:15:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1649056501; bh=70VwlFuP+GZbo2TC9f4ZxwnURtZw5R8y/Z/TSWpF/KQ=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=dIsKubJnA0s7qm6vWglc0xDqWlA37qB4GdLBxBdiKMsBdjhxPWZryYch3YvYYuq8r qRnbHs1MgejdCcauytijwCpXFpLcc830jVXF0Z/Y8YhKwt5SCAATFRMMt/ALSZZsPx Sm0CKnr1Xx29izXwa2BmXkSAW0mRNRSj73IDvZB1ZTEb1Wi9ekBjoUWF+5KW/k3Kcm yVryIJqztGNrpkz1G8EuRir2sMG9DYtc9Kp6UMz58Es5L1mdPpFvitBSmTre73TvAj YsmvLk9Ell4srk9ZBlEzrKRZpmHtz3HmE1+IK4d2iwwe+k1IzCD1xJRtDb5Lz8IvXg IEqPtF4E/dDdA== From: Attila Lendvai Message-ID: <6NiL_Ch8DBvICfU6SITfzvKgAYXSazejBXnarb4WkiHJIy5ueKpiqTd5Jwr5SJiyzUCDxhH-ebv_vUxI5Vf8jD484kNu3Ykc1f6f48nt1ZU=@lendvai.name> In-Reply-To: <04e30e30595ba96786a78c1dbc1768636b5c71e9.camel@telenet.be> References: <04e30e30595ba96786a78c1dbc1768636b5c71e9.camel@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) FTR, the issue is that when Shepherd is booting up, i.e. starting from its confi= g file, it calls the start forms without guarding for any possible exceptio= ns. any error propagates up beyond the loop and up until an unwind protect = that deletes the socket. the reason my system seemed fully functional is that my service was pretty = much the last one to be started. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CI made up the term 'object-oriented', and I can tell you I didn't = have C++ in mind.=E2=80=9D =09=E2=80=94 Alan Kay, OOPSLA '97 From debbugs-submit-bounces@debbugs.gnu.org Thu May 18 08:58:23 2023 Received: (at control) by debbugs.gnu.org; 18 May 2023 12:58:23 +0000 Received: from localhost ([127.0.0.1]:52662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzdD4-0006oR-Tg for submit@debbugs.gnu.org; Thu, 18 May 2023 08:58:23 -0400 Received: from mail-qt1-f172.google.com ([209.85.160.172]:49301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzdD2-0006oD-EY for control@debbugs.gnu.org; Thu, 18 May 2023 08:58:21 -0400 Received: by mail-qt1-f172.google.com with SMTP id d75a77b69052e-3f38d2c36fdso10134291cf.2 for ; Thu, 18 May 2023 05:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684414694; x=1687006694; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=59MSTCN1IDwKqA0fYpDhbsY6bbSfDUi/Gd6BJc7lBf8=; b=aUeyG1sx2OnauNwiaknvdQDaHe+uuLl6mkkPSwTCYDDDG97fvYbW/EYLotxv/y2/yI TFyK3zqtKHLXZCXjYAgJUFXWP7/nivarevWsOEw3sUO7avfZq6TMFkc3YWS7qty8OS4h BS1/KhEHcT5IsOZxhwWU5wIqF25GCUeskHgYptnCUwDErp7geB6c5hHo9YOhBKLbpwP6 KSilmTNHqv8JKjr476dsHMiy/t7ugU9rmSSztnohqYM2kJZiC+qpYymdUEREH9U5GAQe bBM5uiDJcW1D6NLLsFRpqeBUzwmOsk8NAPWJs8x/fJyLdWLUBlDzHXGQLkmEi8tJDUB6 /Xew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684414694; x=1687006694; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=59MSTCN1IDwKqA0fYpDhbsY6bbSfDUi/Gd6BJc7lBf8=; b=GIw1/ujbCosFchbcy58diN9vIDGnTnK3CAGmDYdwARxbPZNmkVdFCGkMQwzewhPhwC 63NUMAXIgKdQU1q3E2TQmsZK4Xv38sif3/8VFZaRIOnUUHRnNiEqBOmA4qwfblTPnSw0 QOWBU2ysJ2OMSxCzTRy4DH+3Bntqj+DSlVaArQw/vhPgXyAY6whquRZC3/meGRILF2xo T1IFhKOXxMSSYxlgmXirmMApdpQkjbdHhkYsO21mscDziAqfEUvl4jYd1zM9RIPpb/ty NZRC3jjg3FtSgiDOvEdlSBayC0HLhJHoTrxSe8Yot52T72Cm04AiYusotnvrZ3BAH/t5 bdog== X-Gm-Message-State: AC+VfDz6DaDBA76dfhvqCFH56KzUGHDyrS2QdT7N6Jla2noRFx373q7g H6nbDedMfCOibalpe+9cFATa9/hiaBu0kA== X-Google-Smtp-Source: ACHHUZ40u7ooH2gKOrH834ZfRqfljpqXM50yV7U1Le8E/UfJUvsbbyTR2rqxxcEX1iPKUlI0d5lYzw== X-Received: by 2002:a05:622a:e:b0:3f5:ba44:119c with SMTP id x14-20020a05622a000e00b003f5ba44119cmr5710125qtw.49.1684414694584; Thu, 18 May 2023 05:58:14 -0700 (PDT) Received: from hurd (dsl-150-33.b2b2c.ca. [66.158.150.33]) by smtp.gmail.com with ESMTPSA id h14-20020ac8514e000000b003f687a4aed4sm476308qtn.55.2023.05.18.05.58.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 05:58:14 -0700 (PDT) Date: Thu, 18 May 2023 08:58:05 -0400 Message-Id: <87o7mhn6ea.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #53580 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) severity 53580 important quit From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 18 May 2023 20:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.168444077622283 (code B ref 53580); Thu, 18 May 2023 20:13:02 +0000 Received: (at 53580) by debbugs.gnu.org; 18 May 2023 20:12:56 +0000 Received: from localhost ([127.0.0.1]:54671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzjzc-0005nL-Ci for submit@debbugs.gnu.org; Thu, 18 May 2023 16:12:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzjzX-0005n5-5t for 53580@debbugs.gnu.org; Thu, 18 May 2023 16:12:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzjzM-0007F8-Fi; Thu, 18 May 2023 16:12:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=AYXbX35sYV9eA7GfVjctxZvrWaL3hUGo09v4tp1kED4=; b=nJqhUi7v6vu2vniEzGAv i1bQMa7eQjqmhvGIaKzZBULgPn32Rj+UKCB3ERMZy2nx3YwSUPgfM5W1CiJQ2JF53pEWS6JaAbOj7 E6Ybbze96ilYCgC5cj/UwjYpmkfagktyOo1TMwhOr9FU1u6QtFovwowJh/Nl9hwuPOpRX2/Rkr0Ek yakJ1WnvsOU9Ec30lsVaJd8FlnL5/uO1/1nXI58EjrXZRuNTtS8TAXJuVYL6Xga15fAPlGQE2fQgq XA0AenuIjOo+dOXRUX1mlbRV6bRwAD/aEFjvLCg6BdrhKxFJUYOms436XE0RxAtIHEEJ4jZaREo9n sFt30jmqXOz1Bw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzjzL-0002rp-VH; Thu, 18 May 2023 16:12:40 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Thu, 18 May 2023 22:12:37 +0200 In-Reply-To: (Attila Lendvai's message of "Thu, 27 Jan 2022 11:32:18 +0000") Message-ID: <87jzx51jre.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Attila, I had totally overlooked this bug report. Attila Lendvai skribis: > the systems seems to work fine. Gnome is up, i can log in with my user, a= nd everything seems to work, except herd. > > i encounter this broken state every once in a while. IRC logs also mentio= n this multiple times, but without many insights: > > https://logs.guix.gnu.org/guix/search?query=3D%2Fvar%2Frun%2Fshepherd%2Fs= ocket > > ``` > # herd status > error: connect: /var/run/shepherd/socket: No such file or directory [...] > the issue is that when Shepherd is booting up, i.e. starting from its con= fig file, it calls the start forms without guarding for any possible except= ions. any error propagates up beyond the loop and up until an unwind protec= t that deletes the socket. > > the reason my system seemed fully functional is that my service was prett= y much the last one to be started. Currently (in 0.10.0), the =E2=80=98run-daemon=E2=80=99 procedure loads the= user=E2=80=99s config file before listening on /var/run/shepherd/socket. However, if an exception is thrown from the config file, it stops: --8<---------------cut here---------------start------------->8--- $ echo '(error "oops")' > /tmp/conf.scm $ ./shepherd -I -s sock -c /tmp/conf.scm Starting service root... Service root started. Service root running with value #t. Service root has been started. misc-error(#f "~A" ("oops") #f) Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message. $ echo $? 1 --8<---------------cut here---------------end--------------->8--- Now, while the config file is being evaluated, shepherd does not listen on its socket, which isn=E2=80=99t great. This is mitigated by the use of =E2=80=98start-in-the-background=E2=80=99 (= introduced in 0.9.0) in the config file, which, as the name implies, doesn=E2=80=99t block further operation. So I *think* we=E2=80=99re mostly okay now. The one thing we could do is l= oad the whole config file in a separate fiber, and maybe it=E2=80=99s fine to k= eep going even when there=E2=80=99s an error during config file evaluation? WDYT? Thanks, Ludo=E2=80=99. From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture References: In-Reply-To: Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 27 May 2023 10:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.16851836449150 (code B ref 53580); Sat, 27 May 2023 10:35:02 +0000 Received: (at 53580) by debbugs.gnu.org; 27 May 2023 10:34:04 +0000 Received: from localhost ([127.0.0.1]:51423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2rFL-0002NW-Dc for submit@debbugs.gnu.org; Sat, 27 May 2023 06:34:03 -0400 Received: from mail-40136.proton.ch ([185.70.40.136]:21345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2rFJ-0002Mw-EZ for 53580@debbugs.gnu.org; Sat, 27 May 2023 06:34:02 -0400 Date: Sat, 27 May 2023 10:33:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1685183634; x=1685442834; bh=sEr0tmZLFsFVrG9O7/DkrLRlBsDVacqtypASo5en9Ls=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=SzVpKthbLmJH09H695FBqC8A7TQT/iwrVmyOv1ELrKAloakIFe1BGhOGSHCoRQP7S I1M3OscFI5xyJexbah4S3lHq0EPAkpxBW2nDs6PMGAglf4JKvnMFyV9N+OIwnAro1+ dxq4tvHaGTM2SdjF7c5teXApXZFiOrPqoSm4ZQlQHCv0mPm0acYIspSjk5U9S755E+ orgwnrEGgsNCAQ9Hic0nTqiUaJHPzbOnAXTSdw1nnaJUMqL5qlORULsRdyqrHWFcL3 iTp0omonR3RfymkiJLdR4FhQtgWnUPlKtzBop2d0vgjA/n/E7372a+aXZ4uLIOg2U8 WAMs1L/PxyEkA== From: Attila Lendvai Message-ID: Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [forked from: bug#53580: /var/run/shepherd/socket is missing on an otherwis= e functional system] > So I think we=E2=80=99re mostly okay now. The one thing we could do is lo= ad > the whole config file in a separate fiber, and maybe it=E2=80=99s fine to= keep > going even when there=E2=80=99s an error during config file evaluation? > > WDYT? i think there's a fundamental issue to be resolved here, and addressing tha= t would implicitly resolve the entire class of issues that this one belongs= to. guile (shepherd) is run as the init process, and because of that it may not= exit or be respawn. but at the same time when we reconfigure a guix system= , then shepherd's config should not only be reloaded, but its internal stat= e merged with the new config, and potentially even with an evolved shepherd= codebase. i still lack a proper mental model of all this to succesfully predict what = will happen when i `guix system reconfigure` after i `guix pull`-ed my serv= ice code, and/or changed the config of my services. -------- this problem of migration is pretty much a CS research topic... ideally, there should be a non-shepherd-specific protocol defined for such = migrations, and the new shpeherd codebase could migrate its state from the = old to the new, with most of the migration code being automatic. some of it= must be hand written as rquired by some semantic changes. even more ideally, we should reflexive systems; admit that source code is a= graph, and store it as one (as opposed to a string of characters); and our= systems should have orthogonal persistency, etc, etc... a far cry from wha= t we have now. Fare's excellent blog has some visionary thoughts on this, especially in: https://ngnghm.github.io/blog/2015/09/08/chapter-5-non-stop-change/ but given that we will not have these any time soon... what can we do now? -------- note: what follows are wild ideas, and i'm not sure i have the necessary un= derstanding of the involved subsystems to properly judge their feasibility.= .. so take them with a pinch of salt. idea 1 -------- it doesn't seem to be an insurmontable task to make sure that guile can saf= ely unlink a module from its heap, check if there are any references into t= he module to be dropped, and then reload this module from disk. the already runing fibers would keep the required code in the heap until af= ter they are stopped/restarted. then the module would get GC'd eventually. this would help solve the problem that a reconfigured service may have a co= mpletely different start/stop code. and by taking some careful shortcuts we= may be able to make reloading work without having to stop the service proc= ess in question. idea 2 -------- another, probably better idea: split up shepherd's codebase into isolated parts: 1) the init process 2) the service runners, which are spawned by 1). let's call this part 'the runner'. 3) the CLI scripts that implement stuff like `reboot` by sending a message to 1). the runner would spawn and manage the actual daemon binaries/processes. the init process would communicate with the runners through a channel/pipe = that is created when the runner are spawn. i.e. here we wouldn't need an IP= C socket file like we need for the communication between the scripts and th= e init process. AFAIU the internal structure of shepherd is already turning into something = like this with the use of fibers and channels. i suspect Ludo has something= like this on his mind already. in this setup most of the complexity and the evolution of the shepherd code= base would happen in the runner, and the other two parts could be kept mini= mal and would rarely need to change (and thus require a reboot). the need for a reboot could be detected by noticing that the compiled binar= y of the init process has changed compared to what is currently running as = PID 1. the driver process of a service could be reloaded/respawned the next time w= hen the daemon is stopped or it quits unexpectedly. -------- recently i've succesfully wrote a shepherd service that spawns a daemon, an= d from a fiber it does two way communication with the daemon using a pipe c= onnected to the daemon's stdio. i guess that counts as a proof of concept f= or the second idea, but i'm not sure about its stability. a stuck/failing s= ervice is a different issue than a stuck/failing init process. for reference, the spawning of the daemon: https://github.com/attila-lendvai/guix-crypto/blob/8f996239bb8c2a1103c3e546= 05faf680fe1ed093/src/guix-crypto/services/swarm.scm#L315 the fiber's code that talks to it: https://github.com/attila-lendvai/guix-crypto/blob/8f996239bb8c2a1103c3e546= 05faf680fe1ed093/src/guix-crypto/swarm-utils.scm#L133 -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CWe reject: kings, presidents and voting. We believe in: rough cons= ensus and running code.=E2=80=9D =09=E2=80=94 David Clark for the IETF From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 28 May 2023 22:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: guix-devel , 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.168531259317691 (code B ref 53580); Sun, 28 May 2023 22:24:01 +0000 Received: (at 53580) by debbugs.gnu.org; 28 May 2023 22:23:13 +0000 Received: from localhost ([127.0.0.1]:54844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3OnA-0004bE-Ts for submit@debbugs.gnu.org; Sun, 28 May 2023 18:23:13 -0400 Received: from mail-4323.proton.ch ([185.70.43.23]:59325) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3On8-0004aw-Dw for 53580@debbugs.gnu.org; Sun, 28 May 2023 18:23:12 -0400 Date: Sun, 28 May 2023 22:23:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail2; t=1685312584; x=1685571784; bh=xKASRMSYfWTEQQZ7z3CEmVHn50M8Dp+chsiiRnlxt04=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=pHvZseBLRcKdIuY8fzpBlhVFz07qakesducHg04tPDVjpltIGwgxFsSoQ/mDN7HuT otdTqAvvqYW0gVJOr42CsQU5ssAzLx2o3hJYiHsGfh1fAV1zQ1Jc/RIsGl8hrYoJk7 d8JXPVBTFeboI46M+lH0qx1ND+u7tc7w6o0U9CKuaHhU26GhLRz6OKzd+ZPbIK7fBR KupvRyCP1Pt4FxlmBbhZ40wn9j0kIp97VAyDj4x+sfAzma8LuxbmvdMS26UQ3t7kzG oXeDrUt8w5cLdKZlNMZ8gHJ+bwTpLX6eUJSWk77beDGgKRPLckQ/ElvokRIfbslMkp bLiaGrxKpePVg== From: Attila Lendvai Message-ID: In-Reply-To: References: Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [resending to include the guix-devel list. apologies for everyone who recei= ves this mail twice!] ------ [forked from: bug#53580: /var/run/shepherd/socket is missing on an otherwis= e functional system] > So I think we=E2=80=99re mostly okay now. The one thing we could do is lo= ad > the whole config file in a separate fiber, and maybe it=E2=80=99s fine to= keep > going even when there=E2=80=99s an error during config file evaluation? >=20 > WDYT? i think there's a fundamental issue to be resolved here, and addressing tha= t would implicitly resolve the entire class of issues that this one belongs= to. guile (shepherd) is run as the init process, and because of that it may not= exit or be respawn. but at the same time when we reconfigure a guix system= , then shepherd's config should not only be reloaded, but its internal stat= e merged with the new config, and potentially even with an evolved shepherd= codebase. i still lack a proper mental model of all this to succesfully predict what = will happen when i `guix system reconfigure` after i `guix pull`-ed my serv= ice code, and/or changed the config of my services. -------- this problem of migration is pretty much a CS research topic... ideally, there should be a non-shepherd-specific protocol defined for such = migrations, and the new shpeherd codebase could migrate its state from the = old to the new, with most of the migration code being automatic. some of it= must be hand written as rquired by some semantic changes. even more ideally, we should reflexive systems; admit that source code is a= graph, and store it as one (as opposed to a string of characters); and our= systems should have orthogonal persistency, etc, etc... a far cry from wha= t we have now. Fare's excellent blog has some visionary thoughts on this, especially in: https://ngnghm.github.io/blog/2015/09/08/chapter-5-non-stop-change/ but given that we will not have these any time soon... what can we do now? -------- note: what follows are wild ideas, and i'm not sure i have the necessary un= derstanding of the involved subsystems to properly judge their feasibility.= .. so take them with a pinch of salt. idea 1 -------- it doesn't seem to be an insurmontable task to make sure that guile can saf= ely unlink a module from its heap, check if there are any references into t= he module to be dropped, and then reload this module from disk. the already runing fibers would keep the required code in the heap until af= ter they are stopped/restarted. then the module would get GC'd eventually. this would help solve the problem that a reconfigured service may have a co= mpletely different start/stop code. and by taking some careful shortcuts we= may be able to make reloading work without having to stop the service proc= ess in question. idea 2 -------- another, probably better idea: split up shepherd's codebase into isolated parts: 1) the init process 2) the service runners, which are spawned by 1). let's call this part 'the runner'. 3) the CLI scripts that implement stuff like `reboot` by sending a message to 1). the runner would spawn and manage the actual daemon binaries/processes. the init process would communicate with the runners through a channel/pipe = that is created when the runner are spawn. i.e. here we wouldn't need an IP= C socket file like we need for the communication between the scripts and th= e init process. AFAIU the internal structure of shepherd is already turning into something = like this with the use of fibers and channels. i suspect Ludo has something= like this on his mind already. in this setup most of the complexity and the evolution of the shepherd code= base would happen in the runner, and the other two parts could be kept mini= mal and would rarely need to change (and thus require a reboot). the need for a reboot could be detected by noticing that the compiled binar= y of the init process has changed compared to what is currently running as = PID 1. the driver process of a service could be reloaded/respawned the next time w= hen the daemon is stopped or it quits unexpectedly. -------- recently i've succesfully wrote a shepherd service that spawns a daemon, an= d from a fiber it does two way communication with the daemon using a pipe c= onnected to the daemon's stdio. i guess that counts as a proof of concept f= or the second idea, but i'm not sure about its stability. a stuck/failing s= ervice is a different issue than a stuck/failing init process. for reference, the spawning of the daemon: https://github.com/attila-lendvai/guix-crypto/blob/8f996239bb8c2a1103c3e546= 05faf680fe1ed093/src/guix-crypto/services/swarm.scm#L315 the fiber's code that talks to it: https://github.com/attila-lendvai/guix-crypto/blob/8f996239bb8c2a1103c3e546= 05faf680fe1ed093/src/guix-crypto/swarm-utils.scm#L133 --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CDying societies accumulate laws like dying men accumulate remedies= .=E2=80=9D =09=E2=80=94 Nicol=C3=A1s G=C3=B3mez D=C3=A1vila (1913=E2=80=931994), 'Esc= olios a un texto implicito: Seleccion' From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 29 May 2023 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: guix-devel@gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.16853724907396 (code B ref 53580); Mon, 29 May 2023 15:02:02 +0000 Received: (at 53580) by debbugs.gnu.org; 29 May 2023 15:01:30 +0000 Received: from localhost ([127.0.0.1]:58883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3eNG-0001vE-2O for submit@debbugs.gnu.org; Mon, 29 May 2023 11:01:30 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:62170 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3eNE-0001v6-11 for 53580@debbugs.gnu.org; Mon, 29 May 2023 11:01:29 -0400 Received: from psyduck (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 74CD4C5C0; Mon, 29 May 2023 11:01:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1685372487; bh=GBvgXnhhruPt3lOV6lJAmSl+yyqn60gHZNoS1Sa6FjA=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=Jh5aM7IGjL6A0biOd7KA7Sa8zuD+MgBPapxcaXMKZeV3WDSi4XFdFIc6HouaVlZ6K ay/yG2wbuMGSa9C3VthC8+CkuImkDxZlAZzZaczzxlFu8qPX3s3V18KMy6yALTGKQX 5mSf5pzh6PuNXxBsShrWCjailgOVKRDA/fkIlM7Q= References: User-agent: mu4e 1.10.2; emacs 30.0.50 From: Brian Cully Date: Mon, 29 May 2023 10:46:31 -0400 In-reply-to: Message-ID: <87fs7fxjut.fsf@psyduck.jhoto.kublai.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Attila Lendvai writes: > it doesn't seem to be an insurmontable task to make sure that > guile > can safely unlink a module from its heap, check if there are any > references into the module to be dropped, and then reload this > module > from disk. > > the already runing fibers would keep the required code in the > heap > until after they are stopped/restarted. then the module would > get GC'd > eventually. > > this would help solve the problem that a reconfigured service > may have > a completely different start/stop code. and by taking some > careful > shortcuts we may be able to make reloading work without having > to stop > the service process in question. Erlang has had hot code reloading for decades, built around the needs of 100% uptime systems. The problem is more complex than it often appears to people who are used to how lisps traditionally do it. I strongly recommend reading up on Erlang's migration system. Briefly: you can't just swap out function definitions, because they rely on non-function state which needs to be migrated along with the function itself, and you can't do it whenever you want, because external actors may be relying on a view of the internal state. To accomplish this, Erlang has a lot of machinery, and it fits in to the core design of the language and runtime which would be extremely difficult to port over to non-Erlang languages. Doing it in Scheme is probably possible in an academic sense, but not in a practical one. OTOH, Lisp Flavoured Erlang exists if you want that syntax. There would definitely be advantages to writing an init (and, indeed, any service that needs 100% uptime) on top of the Erlang virtual machine. But going the other way, by porting Erlang's functionality into Scheme, is going to be a wash. > in this setup most of the complexity and the evolution of the > shepherd > codebase would happen in the runner, and the other two parts > could be > kept minimal and would rarely need to change (and thus require a > reboot). Accepting that dramatic enough changes to PID 1 are going to require a reboot seems reasonable to me. They should be even more rare than kernel updates, and we accept rebooting there already. -bjc From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture Resent-From: Felix Lechner Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 29 May 2023 15:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Brian Cully Cc: guix-devel@gnu.org, Attila Lendvai , Ludovic =?UTF-8?Q?Court=C3=A8s?= , 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.16853735629090 (code B ref 53580); Mon, 29 May 2023 15:20:02 +0000 Received: (at 53580) by debbugs.gnu.org; 29 May 2023 15:19:22 +0000 Received: from localhost ([127.0.0.1]:58901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3eeY-0002MY-HD for submit@debbugs.gnu.org; Mon, 29 May 2023 11:19:22 -0400 Received: from sail-ipv4.us-core.com ([208.82.101.137]:42318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3eeW-0002MO-67 for 53580@debbugs.gnu.org; Mon, 29 May 2023 11:19:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=KNiKJhk0Nndab/y XI89fjnDG+aumOF93Nbd9gfQ0VCY=; h=cc:to:subject:date:from:in-reply-to: references; d=lease-up.com; b=IRXi4TlUeBWfJo6RGqrl8zAEX85PeuU+46Y7PWGT SdgepWIoBDIbiCpBCwF+bDo24ckOl0ZdA3W+z5J6rfh+g2pqS4+t3n0QVSEnCAnAoh4sUU m1KL/UY2kfS0vGCwEsg/1dywR/LZteLKyxColZ8U2OgDECpvIRrH26jZSS/hI= Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 9b59786e (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <53580@debbugs.gnu.org>; Mon, 29 May 2023 15:19:18 +0000 (UTC) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2af30a12e84so35586791fa.0 for <53580@debbugs.gnu.org>; Mon, 29 May 2023 08:19:18 -0700 (PDT) X-Gm-Message-State: AC+VfDxNOZbUgndwI81SEHLGHdeb6HX0p9nDmAVCN+jExjt3ueOqpqAQ HE9jSdpO2jy2vG5cZRbYczp6uc2BTGWWz3g+BZk= X-Google-Smtp-Source: ACHHUZ5oATS/juXSNrKrBgy/2LhuroXgTJBMHcl0Fnz888orzzmPHs5KmeXej6Ji1FHj237fDGyY2YafpVpLPRPLLBo= X-Received: by 2002:a2e:870f:0:b0:2af:2626:9f1c with SMTP id m15-20020a2e870f000000b002af26269f1cmr3526965lji.11.1685373556165; Mon, 29 May 2023 08:19:16 -0700 (PDT) MIME-Version: 1.0 References: <87fs7fxjut.fsf@psyduck.jhoto.kublai.com> In-Reply-To: <87fs7fxjut.fsf@psyduck.jhoto.kublai.com> From: Felix Lechner Date: Mon, 29 May 2023 08:18:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Brian, On Mon, May 29, 2023 at 8:02=E2=80=AFAM Brian Cully via Development of GNU Guix and the GNU System distribution. wrote: > > Erlang has had hot code reloading for decades Thank you for that pointer! I also had Erlang on my mind while reading Attila's message. > Lisp Flavoured Erlang exists if you want that syntax. There > would definitely be advantages to writing an init (and, indeed, > any service that needs 100% uptime) on top of the Erlang virtual > machine. =E2=80=9CTwenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover.=E2=80=9D --- H. Jackson Brown Jr in "P.S. I Love You" Kind regards Felix From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 06 Jun 2023 15:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.168606457616135 (code B ref 53580); Tue, 06 Jun 2023 15:17:02 +0000 Received: (at 53580) by debbugs.gnu.org; 6 Jun 2023 15:16:16 +0000 Received: from localhost ([127.0.0.1]:52813 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6YPv-0004C7-NG for submit@debbugs.gnu.org; Tue, 06 Jun 2023 11:16:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q6YPr-0004Bs-3g for 53580@debbugs.gnu.org; Tue, 06 Jun 2023 11:16:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6YPk-0002QU-Vo; Tue, 06 Jun 2023 11:16:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=aWnUtFLp1b2/N/LlI+xWu+QL073yoIeGVwDQGAO7OgI=; b=CQceg1K1DgarmlNcxCoM 0xb0hXIhGFO1y7YUXbFPkUpo1oxL4U3mA35hbcocPQ5j8CmwtgR2KNNDiqfXzLOtSfnnyBK7PtBN6 vL0GuKB6ikCuGJcHcocMPY4XhycrxlEOKpjC2jj9Sq6kg67CMeJuRrz0167rK6geEoIwXAjmhTpGu Hhn8r/M3sF+HeCrEUzNS8PxIQPMYHJDGnnfxaddbB3+53OLpF1m/rqmGYP4nBnXRF5zO+60SXVVzC VETxnlMHbmWsm2xwZGblC0Xy3A/qvSLN+19VPRZneSdP2o7cxtx9KDKJQ+ukApD7hvDrfNaN3ygcE qq3x5XDrWJzDIg==; Received: from [193.50.110.155] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q6YPj-0001I0-Hy; Tue, 06 Jun 2023 11:16:04 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Octidi 18 Prairial an 231 de la =?UTF-8?Q?R=C3=A9volution,?= jour du Pavot X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 06 Jun 2023 17:16:01 +0200 In-Reply-To: (Attila Lendvai's message of "Sat, 27 May 2023 10:33:41 +0000") Message-ID: <87v8g07ham.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Attila, Attila Lendvai skribis: > [forked from: bug#53580: /var/run/shepherd/socket is missing on an otherw= ise functional system] > >> So I think we=E2=80=99re mostly okay now. The one thing we could do is l= oad >> the whole config file in a separate fiber, and maybe it=E2=80=99s fine t= o keep >> going even when there=E2=80=99s an error during config file evaluation? >> >> WDYT? > > > i think there's a fundamental issue to be resolved here, and addressing t= hat would implicitly resolve the entire class of issues that this one belon= gs to. > > guile (shepherd) is run as the init process, and because of that it may n= ot exit or be respawn. but at the same time when we reconfigure a guix syst= em, then shepherd's config should not only be reloaded, but its internal st= ate merged with the new config, and potentially even with an evolved shephe= rd codebase. Sorry to be direct: is there a concrete bug you=E2=80=99re reporting here? > i still lack a proper mental model of all this to succesfully predict wha= t will happen when i `guix system reconfigure` after i `guix pull`-ed my se= rvice code, and/or changed the config of my services. What happens is that =E2=80=98guix system reconfigure=E2=80=99 loads new se= rvices into the running shepherd. New services simply get started; services for which a same-named service is already running instead get registered as a =E2=80=9Creplacement=E2=80=9D, meaning that the new version of the servic= e only gets started when the user explicitly runs =E2=80=98herd restart SERVICE=E2=80= =99. Non-stop upgrades is ideal, but shepherd alone cannot do that. For instance, nginx supports that, and no init system could implement that on its behalf. Ludo=E2=80=99. From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture Resent-From: Csepp Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Jun 2023 12:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: attila@lendvai.name, 53580@debbugs.gnu.org X-Debbugs-Original-Cc: Attila Lendvai , bug-guix@gnu.org, 53580@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.168622905527369 (code B ref -1); Thu, 08 Jun 2023 12:58:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jun 2023 12:57:35 +0000 Received: from localhost ([127.0.0.1]:55812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7FCp-00077K-0V for submit@debbugs.gnu.org; Thu, 08 Jun 2023 08:57:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:54678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7FCj-00076x-Mi for submit@debbugs.gnu.org; Thu, 08 Jun 2023 08:57:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7FCj-0005hP-Fi for bug-guix@gnu.org; Thu, 08 Jun 2023 08:57:29 -0400 Received: from mx1.riseup.net ([198.252.153.129]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7FCh-0004IT-F9; Thu, 08 Jun 2023 08:57:29 -0400 Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4QcPPb2hzszDqgm; Thu, 8 Jun 2023 12:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1686229043; bh=JSQM68CzUQYEdlDbiVyPJ/50GQI9nB1etrDFYgvQ7fk=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=i8mtPhUSGvlvzGjeUI02p11oEsMno1DtZUwFS4YQVshte/8RTWYUpeRwxVLrgPZ/T dHFPj+cJV18MOMpgXJEHCA+3+EFMDu2wqsxa0M9PEq84xBB5x3v8wFrTy9+x3FnaPt dV/YKJYSNcg+713NEKRS6wzlEXV+E/CZv1CknCcw= X-Riseup-User-ID: F74CA7A4E2C2735395224D981A5312C27A7D38C87A13FBEFCC26490C458A3E48 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4QcPPZ3hXfzFpcn; Thu, 8 Jun 2023 12:57:22 +0000 (UTC) References: <87v8g07ham.fsf@gnu.org> From: Csepp Date: Thu, 08 Jun 2023 14:54:29 +0200 In-reply-to: <87v8g07ham.fsf@gnu.org> Message-ID: <874jnidscx.fsf@riseup.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=198.252.153.129; envelope-from=raingloom@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Ludovic Court=C3=A8s writes: > Hi Attila, > > Attila Lendvai skribis: > >> [forked from: bug#53580: /var/run/shepherd/socket is missing on an other= wise functional system] >> >>> So I think we=E2=80=99re mostly okay now. The one thing we could do is = load >>> the whole config file in a separate fiber, and maybe it=E2=80=99s fine = to keep >>> going even when there=E2=80=99s an error during config file evaluation? >>> >>> WDYT? >> >> >> i think there's a fundamental issue to be resolved here, and >> addressing that would implicitly resolve the entire class of issues >> that this one belongs to. >> >> guile (shepherd) is run as the init process, and because of that it >> may not exit or be respawn. but at the same time when we reconfigure >> a guix system, then shepherd's config should not only be reloaded, >> but its internal state merged with the new config, and potentially >> even with an evolved shepherd codebase. > > Sorry to be direct: is there a concrete bug you=E2=80=99re reporting here? > >> i still lack a proper mental model of all this to succesfully >> predict what will happen when i `guix system reconfigure` after i >> `guix pull`-ed my service code, and/or changed the config of my >> services. > > What happens is that =E2=80=98guix system reconfigure=E2=80=99 loads new = services into > the running shepherd. New services simply get started; services for > which a same-named service is already running instead get registered as > a =E2=80=9Creplacement=E2=80=9D, meaning that the new version of the serv= ice only gets > started when the user explicitly runs =E2=80=98herd restart SERVICE=E2=80= =99. > > Non-stop upgrades is ideal, but shepherd alone cannot do that. For > instance, nginx supports that, and no init system could implement that > on its behalf. > > Ludo=E2=80=99. Do services get a reference to their previously running version? The Minix project was experimenting with supporting something like supervisor trees for high uptime, and one way they were trying to achieve that was by giving services the memory of their previous version, so they could read their state and migrate it to their own memory. From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: shepherd's architecture Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 08 Jun 2023 20:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.168625782821988 (code B ref 53580); Thu, 08 Jun 2023 20:58:02 +0000 Received: (at 53580) by debbugs.gnu.org; 8 Jun 2023 20:57:08 +0000 Received: from localhost ([127.0.0.1]:57649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7Mgu-0005ia-Gs for submit@debbugs.gnu.org; Thu, 08 Jun 2023 16:57:08 -0400 Received: from mail-4018.proton.ch ([185.70.40.18]:11295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7Mgq-0005i2-TG for 53580@debbugs.gnu.org; Thu, 08 Jun 2023 16:57:07 -0400 Date: Thu, 08 Jun 2023 20:56:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1686257817; x=1686517017; bh=U0pXDX4SaD1KYQy7o4BjATa5MMYtHC6AdaI4Urd+cqI=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=EwEABdhsh/tQhca85aXeohHVKEqHBZATyneVHYRqY0ISFHzgy0/neQDde4WJ9XXd0 8v7MYxk9Q/4p9l03j0UX/G29DY1O2EPL+icrqYFWNbTTONnnGlqn0V/mZNksWksl2k PPgRUweSL1CyVO35/cT7k0Yp2IUu22D2EwSz/MucXk9QYOJpnfhPr8N54DZA0AXSdM KewFZL+ufgSiyGT8kYakHahqbuPFHUrHdqG5xCY9o+HkXOSrhrr7wLQgaBOcqDdjec sGv1QewMSEqcvxp11kxPFK1NUEiP2TcbUYLSmm+O9W1Zvd//z99YL/0QxSwD4esE2z QDbek/eHaK1iw== From: Attila Lendvai Message-ID: In-Reply-To: <87v8g07ham.fsf@gnu.org> References: <87v8g07ham.fsf@gnu.org> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Sorry to be direct: is there a concrete bug you=E2=80=99re reporting here= ? i didn't pay careful enough attention to report something specific, but one= thing that pops to mind: when i'm working on my service code, which is `guix pull`ed in from my chan= nel, then after a reconfigure i seem to have to reboot for my new code to g= et activated. a simple `herd restart` on the service didn't seem to be enou= gh. i.e. the guile modules that my service code is using did not get reload= ed into the PID 1 guile. keep in mind that this is a non-trivial service that e.g. spawns a long-liv= ed fiber to talk to the daemon through its stdio while the daemon is runnin= g. IOW, its start GEXP is not just a simple forkexec, but something more co= mplex that uses functions from guile modules that should be reloaded into P= ID 1 when the new version of the service is to be started. --=20 =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9CThe unexamined life is not worth living for a human being.= =E2=80=9D =09=E2=80=94 Socrates (c. 470=E2=80=93399 BC, tried and executed), 'Apology= ' (399 BC) From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 11 Jun 2023 14:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.168649300717826 (code B ref 53580); Sun, 11 Jun 2023 14:17:01 +0000 Received: (at 53580) by debbugs.gnu.org; 11 Jun 2023 14:16:47 +0000 Received: from localhost ([127.0.0.1]:37559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8Ls7-0004dS-AQ for submit@debbugs.gnu.org; Sun, 11 Jun 2023 10:16:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8Ls5-0004dG-BO for 53580@debbugs.gnu.org; Sun, 11 Jun 2023 10:16:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8Lrz-0007XI-Bg; Sun, 11 Jun 2023 10:16:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=P/7MmL+NPnKOxjS6GZOf5IAOfcVIEAXA3VFqX/d7/as=; b=p4/xDWKXVMv2swXvD06a TBxEeWwwJTgHjK4Km42+rKfVYw2rJaCTzYaWYvwOcEmYqlUetHsDh2GOmnPK4JxhfKq6t6Gh/Pj0V 0/yKXOINfQDFEqIlcjimo5RguGlpf0i05a8hMVJhkSCzWMjf/6QfLxUgqkU+2HhJ07HrS2U/8iSXV xDMqrgz/gAiCV39JFtfzLbK4xb8rXG5JKFL7Gr2PhZLPY+k6uH9RRKzSYSYVm8wtnGj/GoqNgpWnh 5g0+OpfHbwqnhq2oE1KTgfzkFfBJcVHg1RvR9UEZRc2maCJb0fkfcA1PP0tn+1Tguto10UcQWtHNM 99Wa9XIDmPz4ag==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8Lry-0004ch-P5; Sun, 11 Jun 2023 10:16:38 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87v8g07ham.fsf@gnu.org> Date: Sun, 11 Jun 2023 16:16:37 +0200 In-Reply-To: (Attila Lendvai's message of "Thu, 08 Jun 2023 20:56:43 +0000") Message-ID: <87352yrsmy.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Attila Lendvai skribis: > when i'm working on my service code, which is `guix pull`ed in from my ch= annel, then after a reconfigure i seem to have to reboot for my new code to= get activated. a simple `herd restart` on the service didn't seem to be en= ough. i.e. the guile modules that my service code is using did not get relo= aded into the PID 1 guile. Guile modules do not get reloaded; there=E2=80=99s no mechanism in place to reload previously-loaded Guile modules. > keep in mind that this is a non-trivial service that e.g. spawns a long-l= ived fiber to talk to the daemon through its stdio while the daemon is runn= ing. IOW, its start GEXP is not just a simple forkexec, but something more = complex that uses functions from guile modules that should be reloaded into= PID 1 when the new version of the service is to be started. OK, got it. There=E2=80=99s not enough info here to be concrete, but I=E2= =80=99d recommend making it a separate process if you need to reliably reload/replace the module. IOW, you=E2=80=99d make it a =E2=80=9Cregular= =E2=80=9D service spawned with =E2=80=98make-forkexec-constructor=E2=80=99 or similar. However this doesn=E2=80=99t have anything to do with the initial bug repor= t and the title of this message; for clarity, please move further discussion to guix-devel. Thanks, Ludo=E2=80=99. From unknown Thu Sep 11 11:56:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#53580: /var/run/shepherd/socket is missing on an otherwise functional system Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 11 Jun 2023 14:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53580 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Attila Lendvai Cc: 53580@debbugs.gnu.org Received: via spool by 53580-submit@debbugs.gnu.org id=B53580.168649311318004 (code B ref 53580); Sun, 11 Jun 2023 14:19:02 +0000 Received: (at 53580) by debbugs.gnu.org; 11 Jun 2023 14:18:33 +0000 Received: from localhost ([127.0.0.1]:37564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8Lto-0004gK-TW for submit@debbugs.gnu.org; Sun, 11 Jun 2023 10:18:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8Ltn-0004g7-Kf for 53580@debbugs.gnu.org; Sun, 11 Jun 2023 10:18:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8Lth-0007u9-IC; Sun, 11 Jun 2023 10:18:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=IIFriXbR1aiHc8e1MdElOCYdcHt7soFRnAMBaVQQUss=; b=eYPZxyiX33Zt5BdhunaH C23Qtn51/hWK2eRHUjDNt+MD+y3RVWkfoaz9Xik/RHKJGN6gDSoV0bCy4jIaBzvHlVtboAWa4ngVD 5zXFU1k43v1Mt2PwwD39AMxVx+GXdUH4Nx/QI0KrAoSb4Ttynyx/cbngoUVwR3hjpnnJef1OXaAQB HSMrpSekEZyTLJNEO0g21clJTrCw3sEtQTHeREKJ0rmsyEuUvuVTbaTu85vt5hEj7pgRPiQmQX45O VYvnED7/bwajvJnD8KjePKotwtrq4TEKOrY9x08onrxb9jtND3H4UlS5nWRU2HDXxikwk1u4sSKx4 YtC0MvJbQObo+w==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q8Lth-00050p-6L; Sun, 11 Jun 2023 10:18:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Sun, 11 Jun 2023 16:18:22 +0200 In-Reply-To: (Attila Lendvai's message of "Thu, 27 Jan 2022 11:32:18 +0000") Message-ID: <87y1kqqdzl.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Attila Lendvai skribis: > (define (call-with-server-socket file-name proc) > "Call PROC, passing it a listening socket at FILE-NAME and deleting the > socket file at FILE-NAME upon exit of PROC. Return the values of PROC." > (let ((sock (open-server-socket file-name))) > (dynamic-wind > noop > (lambda () (proc sock)) > (lambda () > (close sock) > (catch-system-error (delete-file file-name)))))) For the record, =E2=80=98dynamic-wind=E2=80=99 here was replaced by =E2=80= =98catch=E2=80=99 in 46790f9d924af2a9521adccb9e6db6afd9c1a2e7, which corresponds to the introduction of Fibers in 0.9.x. Ludo=E2=80=99.