From patchwork Sat Mar 22 18:23:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 40650 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BEE3027BBEC; Sat, 22 Mar 2025 18:25:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2331227BBE2 for ; Sat, 22 Mar 2025 18:25:32 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tw3Wq-0003Ll-Nl; Sat, 22 Mar 2025 14:25:04 -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 1tw3Wo-0003KJ-PZ for guix-patches@gnu.org; Sat, 22 Mar 2025 14:25:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tw3Wo-0007Sv-9E for guix-patches@gnu.org; Sat, 22 Mar 2025 14:25:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=3uvC8Do/dW7R29ikCRwTdB7fEOK6nqqpHzpQ0qoHDFQ=; b=ve3deRTwgzXLUNV/aMnbBSFTCeubew5z1qE3lDR17KmaxAIjI16TX9OOQ830AeoOx5RJxMauM79Cfvf1CrkehSqW8kCPGVrg40fCEVYYxY0NA9sDk12K82KbRadA3x/ztqwYhPZedfAT1j5btYCribSO0oJS8KWrA5MSwQMLdBPbm0tCR0ekrwlYbdtrwYHDd3r49ntrhCCm65fCAGT81WziAuUExlYxFiVebE3H4rAzJ8meNxgdYpIXICyESmfqqkdVeIi4AfqCUdygFw4Ngv9p2Oviydghei6oe65rL4EMeCwtK6APK/dm+WHKDltkmqKbRYIdAI1QBkF6GeyE+w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tw3Wo-0007vW-4l for guix-patches@gnu.org; Sat, 22 Mar 2025 14:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#77189] [PATCH 2/3] services: guix: Streamline the default =?utf-8?b?4oCYc3RhcnTigJk=?= case. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Mar 2025 18:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 77189 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 77189@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 77189-submit@debbugs.gnu.org id=B77189.174266785230257 (code B ref 77189); Sat, 22 Mar 2025 18:25:02 +0000 Received: (at 77189) by debbugs.gnu.org; 22 Mar 2025 18:24:12 +0000 Received: from localhost ([127.0.0.1]:45406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tw3W0-0007rw-5L for submit@debbugs.gnu.org; Sat, 22 Mar 2025 14:24:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40224) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tw3Vt-0007qh-SY for 77189@debbugs.gnu.org; Sat, 22 Mar 2025 14:24:06 -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 1tw3Vo-0007Mw-Aa; Sat, 22 Mar 2025 14:24:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=3uvC8Do/dW7R29ikCRwTdB7fEOK6nqqpHzpQ0qoHDFQ=; b=CP47KBauXxaiBN+8myTY 3cbT03C8YpkUCW7T9Rzik/Mp/bdaYrqL+IVIRV26fBucSEundk4rJyk8BwhFKQ/I2Z9l/vez7ZG86 CxvC7JUnOgGIvS0iPHoffJk91llqd5YGl/vL13OEBpZ4GAawDA9huesDY2RtHhPEZZKpAdfR4yWRE wRGL8j8rSkat5RlqGKrY5UcZ705EVJFLppE5iUP4UeZOH/87CNKflru01DNFudHvuQMkV8wah/Q1k byDwkE3ANg9Jt8UXrgDYCO86XS3famIM/nefaHId3DVc1GefaV1eBKUSlU16hNnO4TDxHSWrtIXZR Mu97P6wDSB4I3A==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 22 Mar 2025 19:23:35 +0100 Message-ID: <993d04f2cd1957d02ac054fc403c9436807f7734.1742667082.git.ludo@gnu.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/services/base.scm (guix-shepherd-service): In ‘start’ method, use ‘fork+exec-command’ in the default case. Change-Id: Id04d3d2651f89fbcdb2f17f027df91e132ff9ed1 --- gnu/services/base.scm | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 6793822666..c7abc9b422 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2137,23 +2137,20 @@ (define (guix-shepherd-service config) (gid (if group (group:gid (getgrnam group)) -1))) (chown "/var/guix/daemon-socket" uid gid)) - ;; Start the guix-daemon from a container, when supported, - ;; to solve an installation issue. See the comment below for - ;; more details. - (fork+exec-command/container - daemon-command - - ;; When running the installer, we need guix-daemon to - ;; operate from within the same MNT namespace as the - ;; installation container. In that case only, enter the - ;; namespace of the process PID passed as start argument. - ;; Otherwise, for symmetry purposes enter the caller - ;; namespaces which is a no-op. - #:pid (match args - ((pid) (string->number pid)) - (else (getpid))) - #:environment-variables environment-variables - #:log-file #$log-file)))) + (match args + (((= string->number (? integer? pid))) + ;; Start the guix-daemon in the same mnt namespace as + ;; PID. This is necessary when running the installer. + (fork+exec-command/container + daemon-command + #:pid pid + #:environment-variables environment-variables + #:log-file #$log-file)) + (() + (fork+exec-command daemon-command + #:environment-variables + environment-variables + #:log-file #$log-file)))))) (stop #~(make-kill-destructor)))))) (define (guix-accounts config)