From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eCldFVXqamLJegAAbAwnHQ (envelope-from ) for ; Thu, 28 Apr 2022 21:26:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YNCqFVXqamJYOgEA9RJhRA (envelope-from ) for ; Thu, 28 Apr 2022 21:26:13 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E43BE3B62E for ; Thu, 28 Apr 2022 21:26:12 +0200 (CEST) Received: from localhost ([::1]:58880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nk9mF-0000zu-Pw for larch@yhetil.org; Thu, 28 Apr 2022 15:26:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk9m7-0000zW-0E for guix-patches@gnu.org; Thu, 28 Apr 2022 15:26:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56095) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nk9m6-0006Gv-Hi for guix-patches@gnu.org; Thu, 28 Apr 2022 15:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nk9m6-0004o1-Ak for guix-patches@gnu.org; Thu, 28 Apr 2022 15:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54997] [PATCH 00/12] Add "least authority" program wrapper Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Apr 2022 19:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 54997@debbugs.gnu.org Received: via spool by 54997-submit@debbugs.gnu.org id=B54997.165117393318415 (code B ref 54997); Thu, 28 Apr 2022 19:26:02 +0000 Received: (at 54997) by debbugs.gnu.org; 28 Apr 2022 19:25:33 +0000 Received: from localhost ([127.0.0.1]:49986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk9ld-0004mx-EJ for submit@debbugs.gnu.org; Thu, 28 Apr 2022 15:25:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk9lb-0004mg-Cp for 54997@debbugs.gnu.org; Thu, 28 Apr 2022 15:25:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk9lW-0006Dy-2m; Thu, 28 Apr 2022 15:25:26 -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=Xxswlh9sH1LZJkBlfhBH81E5mY9PFQXM5CUgvMpn9Us=; b=FaSHJqL2gCpUrLwoxZBX xM6BYPe8woADBTGh2lcXcZksC9o6zL+DuNgA47YAjyxlz2PwiEPgQI60Yo+ZDx+W0YxqMCRM7n/wB 4o3t/KlErZOppB0cDPAXkD0MptN6oC0d/f9umirCxrtNl/4Zdq9uvfLOqJ32doh3uCvMfHboQAPG8 AOOt56peiUSBlmid54omDjFv67fnvtR67hosjRO3i2yf00Tp0DwjdNEd+TkqxQ1B+2ij9xUL8sh/Q L1vnaYmtsukbDbCjpTFZUE08ugJmWn+JLD1yNPLQvdq7365xtIPrFOuBtuU0pqjpnqNaQAT8a+0Sf JioF6DiSSi4vew==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:53600 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk9lP-00074f-0A; Thu, 28 Apr 2022 15:25:24 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220417210453.27884-1-ludo@gnu.org> <20220417210453.27884-9-ludo@gnu.org> <4eac7fd571ddafd46bcadfa2ef5c6b3e41a162ab.camel@telenet.be> <8735i8ratp.fsf_-_@gnu.org> <616af1474c44d6c1caf71fa1f9d263ff46462201.camel@telenet.be> <878rrqgp7x.fsf@gnu.org> <31ff48d9240cf1ab53405c097bbe7148be3ed3bf.camel@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?UTF-8?Q?Flor=C3=A9al?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= 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: Thu, 28 Apr 2022 21:25:17 +0200 In-Reply-To: <31ff48d9240cf1ab53405c097bbe7148be3ed3bf.camel@telenet.be> (Maxime Devos's message of "Thu, 28 Apr 2022 13:29:39 +0200") Message-ID: <87pml1au3m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651173972; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Xxswlh9sH1LZJkBlfhBH81E5mY9PFQXM5CUgvMpn9Us=; b=S4J32MHH+4KwAkK167mpMgMCzQ9koA//qxi7K83gkBz2xrrh640hxBISP4L6d7mt+vxTko EHg1cYm7kv8Rd+NF912dBa0ElymPI/8GcnxGTscRNUcKAjWaGwq9Zw6oaYXIl4bTowmfC+ 4iJgwgc8xKK7+YXj8U4gtwcNCqCFxJK7IzdcS21Z8xgJT5BuhhMDwpdR3W4Jxb+2F71VeE 7lriI+qZ6/8My0tDsVfRKfxYz+jRbfI9bOuvkgUfZa0CN8UTeakoJdi4fE6eHZbUawibGZ LTDuUcEhLh3wTFqHEbHtb/DmQ03GAkNOI06R+g7dni/5HWlRpGQkTz0R2jEKBQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651173972; a=rsa-sha256; cv=none; b=gxVD0YoqlGAXVA7gt82kJ0jeZe6e5KbS4c0On5VS6DgbRKKVzgm+F0bdLOkWqgbMf4rLej i21FrVYjC/4/E7FNJZfpJZ69bIBSagJPsEOiEMH04twYBQtHV4ldJKIIBBbygBM7QZT051 wWBzpSUyEycNJDbUolYJn5DdtF0M76HDmCI08FWkb7cLdY4IJRC5eN6XFks/iPEy7yJ0rW XpU5FJ8lFo++HZg4ZKKI7tpy2CNJKPaZWPHWwb3BsiwLb81IbNB+i6vOMdI4dsvIjR3f6t gZOCJDQgH6cHHifRXCF1B1dUdYNqt5AETKNj4naljYEeNaOMxQaVKmyQZldpDQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FaSHJqL2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FaSHJqL2; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E43BE3B62E X-Spam-Score: -3.90 X-Migadu-Scanner: scn1.migadu.com X-TUID: odgv+f5mWqnt Hi Maxime, Maxime Devos skribis: > Ludovic Court=C3=A8s schreef op do 28-04-2022 om 00:01 [+0200]: >> > Also, having to do fork, waitpid and primitive-fork seems rather >> > low-level to me, so I prefer moving this code into somewhere like >> > (gnu build SOMEWHERE) or to keep the old make-forkexec- >> > constructor/container code. >>=20 >> =E2=80=98primitive-fork=E2=80=99 and =E2=80=98waitpid=E2=80=99 calls are= in (gnu build linux- >> container) >> right now so I guess we=E2=80=99re fine? > > Their use in (gnu build linux-container) seems fine to me, but their > use in %ipfs-activation doesn't: > >> + #~(let ((pid (primitive-fork))) >> + (if (zero? pid) >> + (dynamic-wind >> + (const #t) >> + (lambda () >> + [...] (execl #$(ipfs-binary config) #$@args))) >> + (lambda () >> + (primitive-exit 127))) Oh I see, and I agree. Now, to be fair, this patch deletes more lines than it adds: > * gnu/services/networking.scm (ipfs-binary): Call > 'least-authority-wrapper'. > (%ipfs-home-mapping): Remove surrounding gexp. > (ipfs-shepherd-service)[exec-command]: New procedure. > [ipfs-config-command, set-config!-gexp, shepherd&co] > [container-gexp, container-script]: Remove. > [inner-gexp]: Use 'exec-command'. > --- > gnu/services/networking.scm | 123 +++++++++++++++++------------------- > 1 file changed, 58 insertions(+), 65 deletions(-) The previous code abused =E2=80=98make-forkexec-constructor/container=E2=80= =99 as a way to spawn processes during activation, which wasn=E2=80=99t great either IMO. So yes, I agree there=E2=80=99s room for improvement here and that this cal= ls for some kind of =E2=80=98system*=E2=80=99 interface, if the need is common= enough. But! I don=E2=80=99t think this is a blocker for the whole series. WDYT? :-) Thanks, Ludo=E2=80=99.