From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH 0/2] Activate system when switching generations. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Feb 2021 13:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16134804554085 (code B ref -1); Tue, 16 Feb 2021 13:01:01 +0000 Received: (at submit) by debbugs.gnu.org; 16 Feb 2021 13:00:55 +0000 Received: from localhost ([127.0.0.1]:39759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBzyI-00013d-Q6 for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:00:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:42692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBzyG-00011T-Kc for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:00:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBzyG-0002Rd-Ag for guix-patches@gnu.org; Tue, 16 Feb 2021 08:00:52 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:37045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBzyD-0000HQ-Ia for guix-patches@gnu.org; Tue, 16 Feb 2021 08:00:51 -0500 Received: from localhost (reverse4.evolix.net [31.170.9.129]) (Authenticated sender: brice@waegenei.re) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 55E5C240017 for ; Tue, 16 Feb 2021 13:00:42 +0000 (UTC) From: Brice Waegeneire Date: Tue, 16 Feb 2021 13:35:46 +0100 Message-ID: <87czx06ubt.fsf@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.178.230; envelope-from=brice@waegenei.re; helo=relay10.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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.6 (-) 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.6 (--) Hello, As reported on previous bug report, rolling-back or switching generation doesn't activate the system as a system reconfiguration would do. This is especially problematic when modifying in /run/setuid-programs, as it can't be reverted easily. Also it hinder modification in the activation script since it's not straight forward to revert change made by those script without a functional roll-back mechanism. I'm not sure it's the right approach but at least it work: it add the activate.scm script to the system profile and then load it when switching-generation. This is related to issues: - #37596 and #38884 (they are duplicate) - #36855 a more wider discussion Cheers, - Brice Brice Waegeneire (2): gnu: services: Add activate script to the profile system directory. scripts: system: Activate system when switching generations. gnu/services.scm | 10 +++++++++- guix/scripts/system.scm | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) -- 2.30.1 From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH 1/2] gnu: services: Add activate script to the profile system directory. References: <87czx06ubt.fsf@waegenei.re> In-Reply-To: <87czx06ubt.fsf@waegenei.re> Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Feb 2021 13:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.161348176919369 (code B ref 46560); Tue, 16 Feb 2021 13:23:02 +0000 Received: (at 46560) by debbugs.gnu.org; 16 Feb 2021 13:22:49 +0000 Received: from localhost ([127.0.0.1]:39821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC0JU-00052L-Vc for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:22:49 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:50381) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC0JS-00051z-Gy for 46560@debbugs.gnu.org; Tue, 16 Feb 2021 08:22:47 -0500 X-Originating-IP: 31.170.9.129 Received: from localhost (reverse4.evolix.net [31.170.9.129]) (Authenticated sender: brice@waegenei.re) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id BCFDEFF80D for <46560@debbugs.gnu.org>; Tue, 16 Feb 2021 13:22:39 +0000 (UTC) From: Brice Waegeneire Date: Tue, 16 Feb 2021 14:22:34 +0100 Message-Id: <20210216132235.15811-1-brice@waegenei.re> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (-) * gnu/services.scm (activation-profile-entry): New procedure... (activation-service-type): ... use it. --- gnu/services.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/services.scm b/gnu/services.scm index 13259dfaee..ddd1bac30c 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -617,13 +617,21 @@ ACTIVATION-SCRIPT-TYPE." "Return a gexp that runs the activation script containing GEXPS." #~(primitive-load #$(activation-script gexps))) +(define (activation-profile-entry gexps) + "Return, as a monadic value, an entry for the activation script in the +system directory." + (mlet %store-monad ((activate (lower-object (activation-script gexps)))) + (return `(("activate" ,activate))))) + (define (second-argument a b) b) (define activation-service-type (service-type (name 'activate) (extensions (list (service-extension boot-service-type - gexps->activation-gexp))) + gexps->activation-gexp) + (service-extension system-service-type + activation-profile-entry))) (compose identity) (extend second-argument) (description -- 2.30.1 From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH 2/2] scripts: system: Activate system when switching generations. References: <87czx06ubt.fsf@waegenei.re> In-Reply-To: <87czx06ubt.fsf@waegenei.re> Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 16 Feb 2021 13:23:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.161348177119379 (code B ref 46560); Tue, 16 Feb 2021 13:23:03 +0000 Received: (at 46560) by debbugs.gnu.org; 16 Feb 2021 13:22:51 +0000 Received: from localhost ([127.0.0.1]:39823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC0JX-00052U-8x for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:22:51 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:47919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lC0JT-000522-M7 for 46560@debbugs.gnu.org; Tue, 16 Feb 2021 08:22:48 -0500 X-Originating-IP: 31.170.9.129 Received: from localhost (reverse4.evolix.net [31.170.9.129]) (Authenticated sender: brice@waegenei.re) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 24D6DC0009 for <46560@debbugs.gnu.org>; Tue, 16 Feb 2021 13:22:40 +0000 (UTC) From: Brice Waegeneire Date: Tue, 16 Feb 2021 14:22:35 +0100 Message-Id: <20210216132235.15811-2-brice@waegenei.re> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (-) Fixes #38884. * guix/scripts/system.scm (switch-to-system-generation): Load the activate script for that generation. --- guix/scripts/system.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 19b8c5163c..4c7af52ad5 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2021 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -363,11 +364,14 @@ connection to the store." "Switch the system profile to the generation specified by SPEC, and re-install bootloader with a configuration file that uses the specified system generation as its default entry. STORE is an open connection to the store." - (let ((number (relative-generation-spec->number %system-profile spec))) + (let* ((number (relative-generation-spec->number %system-profile spec)) + (generation (generation-file-name %system-profile number)) + (activate (string-append generation "/activate"))) (if number (begin (reinstall-bootloader store number) - (switch-to-generation* %system-profile number)) + (switch-to-generation* %system-profile number) + (primitive-load activate)) (leave (G_ "cannot switch to system generation '~a'~%") spec)))) (define* (system-bootloader-name #:optional (system %system-profile)) -- 2.30.1 From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH 0/2] Activate system when switching generations. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Mar 2021 15:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brice Waegeneire Cc: 46560@debbugs.gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.16146141395363 (code B ref 46560); Mon, 01 Mar 2021 15:56:01 +0000 Received: (at 46560) by debbugs.gnu.org; 1 Mar 2021 15:55:39 +0000 Received: from localhost ([127.0.0.1]:50497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGktX-0001OR-35 for submit@debbugs.gnu.org; Mon, 01 Mar 2021 10:55:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGktV-0001OD-SP for 46560@debbugs.gnu.org; Mon, 01 Mar 2021 10:55:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47526) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGktQ-0003xC-0z; Mon, 01 Mar 2021 10:55:32 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55386 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lGktP-0002a8-AB; Mon, 01 Mar 2021 10:55:31 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87czx06ubt.fsf@waegenei.re> <20210216132235.15811-1-brice@waegenei.re> Date: Mon, 01 Mar 2021 16:55:29 +0100 In-Reply-To: <20210216132235.15811-1-brice@waegenei.re> (Brice Waegeneire's message of "Tue, 16 Feb 2021 14:22:34 +0100") Message-ID: <87mtvmrhqm.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 (-) Hi, Brice Waegeneire skribis: > * gnu/services.scm (activation-profile-entry): New procedure... > (activation-service-type): ... use it. [...] > +(define (activation-profile-entry gexps) > + "Return, as a monadic value, an entry for the activation script in the > +system directory." > + (mlet %store-monad ((activate (lower-object (activation-script gexps)))) > + (return `(("activate" ,activate))))) > + > (define (second-argument a b) b) > > (define activation-service-type > (service-type (name 'activate) > (extensions > (list (service-extension boot-service-type > - gexps->activation-gexp))) > + gexps->activation-gexp) > + (service-extension system-service-type > + activation-profile-entry))) Good idea, LGTM! From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH 0/2] Activate system when switching generations. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 01 Mar 2021 15:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brice Waegeneire Cc: 46560@debbugs.gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.16146142185480 (code B ref 46560); Mon, 01 Mar 2021 15:57:02 +0000 Received: (at 46560) by debbugs.gnu.org; 1 Mar 2021 15:56:58 +0000 Received: from localhost ([127.0.0.1]:50501 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGkuo-0001QJ-DD for submit@debbugs.gnu.org; Mon, 01 Mar 2021 10:56:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGkum-0001Q7-8N for 46560@debbugs.gnu.org; Mon, 01 Mar 2021 10:56:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:47540) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGkuh-0004fr-0h; Mon, 01 Mar 2021 10:56:51 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=55392 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lGkub-0003Zw-Db; Mon, 01 Mar 2021 10:56:47 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87czx06ubt.fsf@waegenei.re> <20210216132235.15811-2-brice@waegenei.re> Date: Mon, 01 Mar 2021 16:56:44 +0100 In-Reply-To: <20210216132235.15811-2-brice@waegenei.re> (Brice Waegeneire's message of "Tue, 16 Feb 2021 14:22:35 +0100") Message-ID: <87im6arhoj.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (-) Brice Waegeneire skribis: > Fixes #38884. Nitpick: =E2=80=9CFixes .=E2=80=9D > * guix/scripts/system.scm (switch-to-system-generation): Load the > activate script for that generation. [...] > + (switch-to-generation* %system-profile number) > + (primitive-load activate)) I suppose you need to wrap catch 'system-error here and to keep going upon ENOENT. Could you send an updated patch? Thanks! Ludo=E2=80=99. From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH v2 0/2] Activate system when switching generations. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Mar 2021 06:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.16148410863342 (code B ref 46560); Thu, 04 Mar 2021 06:59:01 +0000 Received: (at 46560) by debbugs.gnu.org; 4 Mar 2021 06:58:06 +0000 Received: from localhost ([127.0.0.1]:57520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhvy-0000rq-7W for submit@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:06 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:45879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhvw-0000rJ-Ud for 46560@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:05 -0500 X-Originating-IP: 176.181.186.101 Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr [176.181.186.101]) (Authenticated sender: brice@waegenei.re) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id EC73140007; Thu, 4 Mar 2021 06:57:58 +0000 (UTC) From: Brice Waegeneire Date: Thu, 4 Mar 2021 07:57:52 +0100 Message-Id: <20210304065754.18619-1-brice@waegenei.re> X-Mailer: git-send-email 2.30.1 In-Reply-To: <87czx06ubt.fsf@waegenei.re> References: <87czx06ubt.fsf@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (-) Hello Ludovic, Ludovic Courtès writes: > Brice Waegeneire skribis: > > > Fixes #38884. > > Nitpick: “Fixes .” > > > * guix/scripts/system.scm (switch-to-system-generation): Load the > > activate script for that generation. > > [...] > > > + (switch-to-generation* %system-profile number) > > + (primitive-load activate)) > > I suppose you need to wrap catch 'system-error here and to keep going > upon ENOENT. This patch set fixes both issues. Cheers, - Brice Brice Waegeneire (2): gnu: services: Add activate script to the profile system directory. scripts: system: Activate system when switching generations. gnu/services.scm | 10 +++++++++- guix/scripts/system.scm | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) -- 2.30.1 From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH v2 1/2] gnu: services: Add activate script to the profile system directory. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Mar 2021 06:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.16148410883361 (code B ref 46560); Thu, 04 Mar 2021 06:59:02 +0000 Received: (at 46560) by debbugs.gnu.org; 4 Mar 2021 06:58:08 +0000 Received: from localhost ([127.0.0.1]:57524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhw0-0000s4-G1 for submit@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:08 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:48415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhvy-0000rS-Sf for 46560@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:07 -0500 X-Originating-IP: 176.181.186.101 Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr [176.181.186.101]) (Authenticated sender: brice@waegenei.re) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id D4DD0FF805; Thu, 4 Mar 2021 06:57:59 +0000 (UTC) From: Brice Waegeneire Date: Thu, 4 Mar 2021 07:57:53 +0100 Message-Id: <20210304065754.18619-2-brice@waegenei.re> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210304065754.18619-1-brice@waegenei.re> References: <87czx06ubt.fsf@waegenei.re> <20210304065754.18619-1-brice@waegenei.re> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (-) * gnu/services.scm (activation-profile-entry): New procedure... (activation-service-type): ... use it. --- gnu/services.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/services.scm b/gnu/services.scm index 13259dfaee..ddd1bac30c 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -617,13 +617,21 @@ ACTIVATION-SCRIPT-TYPE." "Return a gexp that runs the activation script containing GEXPS." #~(primitive-load #$(activation-script gexps))) +(define (activation-profile-entry gexps) + "Return, as a monadic value, an entry for the activation script in the +system directory." + (mlet %store-monad ((activate (lower-object (activation-script gexps)))) + (return `(("activate" ,activate))))) + (define (second-argument a b) b) (define activation-service-type (service-type (name 'activate) (extensions (list (service-extension boot-service-type - gexps->activation-gexp))) + gexps->activation-gexp) + (service-extension system-service-type + activation-profile-entry))) (compose identity) (extend second-argument) (description -- 2.30.1 From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH v2 2/2] scripts: system: Activate system when switching generations. Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Mar 2021 06:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 46560@debbugs.gnu.org Cc: ludo@gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.16148410913372 (code B ref 46560); Thu, 04 Mar 2021 06:59:02 +0000 Received: (at 46560) by debbugs.gnu.org; 4 Mar 2021 06:58:11 +0000 Received: from localhost ([127.0.0.1]:57526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhw2-0000sK-OL for submit@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:11 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:29273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHhvz-0000rf-Vo for 46560@debbugs.gnu.org; Thu, 04 Mar 2021 01:58:08 -0500 X-Originating-IP: 176.181.186.101 Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr [176.181.186.101]) (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id EE9CC240003; Thu, 4 Mar 2021 06:58:01 +0000 (UTC) From: Brice Waegeneire Date: Thu, 4 Mar 2021 07:57:54 +0100 Message-Id: <20210304065754.18619-3-brice@waegenei.re> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210304065754.18619-1-brice@waegenei.re> References: <87czx06ubt.fsf@waegenei.re> <20210304065754.18619-1-brice@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (-) Fixes . * guix/scripts/system.scm (switch-to-system-generation): Load the activate script for that generation. squash! scripts: system: Activate system when switching generations. --- guix/scripts/system.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index e3cf99acc6..c226f08371 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2021 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -363,11 +364,14 @@ connection to the store." "Switch the system profile to the generation specified by SPEC, and re-install bootloader with a configuration file that uses the specified system generation as its default entry. STORE is an open connection to the store." - (let ((number (relative-generation-spec->number %system-profile spec))) + (let* ((number (relative-generation-spec->number %system-profile spec)) + (generation (generation-file-name %system-profile number)) + (activate (string-append generation "/activate"))) (if number (begin (reinstall-bootloader store number) - (switch-to-generation* %system-profile number)) + (switch-to-generation* %system-profile number) + (unless-file-not-found (primitive-load activate))) (leave (G_ "cannot switch to system generation '~a'~%") spec)))) (define* (system-bootloader-name #:optional (system %system-profile)) -- 2.30.1 From unknown Thu Jun 19 14:29:39 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#46560] [PATCH v2 0/2] Activate system when switching generations. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 08 Mar 2021 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46560 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brice Waegeneire Cc: 46560@debbugs.gnu.org Received: via spool by 46560-submit@debbugs.gnu.org id=B46560.161521291910862 (code B ref 46560); Mon, 08 Mar 2021 14:16:02 +0000 Received: (at 46560) by debbugs.gnu.org; 8 Mar 2021 14:15:19 +0000 Received: from localhost ([127.0.0.1]:42462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJGfH-0002p8-0j for submit@debbugs.gnu.org; Mon, 08 Mar 2021 09:15:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42602) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJGfF-0002os-8n for 46560@debbugs.gnu.org; Mon, 08 Mar 2021 09:15:17 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48194) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGf9-0003J9-2m; Mon, 08 Mar 2021 09:15:11 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=41028 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lJGf1-00029W-Eg; Mon, 08 Mar 2021 09:15:09 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87czx06ubt.fsf@waegenei.re> <20210304065754.18619-1-brice@waegenei.re> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 =?UTF-8?Q?Vent=C3=B4se?= an 229 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: Mon, 08 Mar 2021 15:15:02 +0100 In-Reply-To: <20210304065754.18619-1-brice@waegenei.re> (Brice Waegeneire's message of "Thu, 4 Mar 2021 07:57:52 +0100") Message-ID: <87blbtd95l.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (-) Hi Brice, Brice Waegeneire skribis: > Brice Waegeneire (2): > gnu: services: Add activate script to the profile system directory. > scripts: system: Activate system when switching generations. LGTM, thanks! Ludo=E2=80=99. From unknown Thu Jun 19 14:29:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Brice Waegeneire Subject: bug#46560: closed (Re: bug#46560: [PATCH 0/2] Activate system when switching generations.) Message-ID: References: <87k0qgzwh3.fsf_-_@waegenei.re> <87czx06ubt.fsf@waegenei.re> X-Gnu-PR-Message: they-closed 46560 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 46560@debbugs.gnu.org Date: Tue, 09 Mar 2021 06:13:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1615270381-14419-1" This is a multi-part message in MIME format... ------------=_1615270381-14419-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #46560: [PATCH 0/2] Activate system when switching generations. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 46560@debbugs.gnu.org. --=20 46560: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D46560 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1615270381-14419-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 46560-done) by debbugs.gnu.org; 9 Mar 2021 06:12:52 +0000 Received: from localhost ([127.0.0.1]:45423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJVbw-0003kB-G5 for submit@debbugs.gnu.org; Tue, 09 Mar 2021 01:12:52 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:35829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lJVbv-0003ju-0J for 46560-done@debbugs.gnu.org; Tue, 09 Mar 2021 01:12:51 -0500 X-Originating-IP: 176.181.186.101 Received: from localhost (i15-les02-ntr-176-181-186-101.sfr.lns.abo.bbox.fr [176.181.186.101]) (Authenticated sender: brice@waegenei.re) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 08E6BFF803; Tue, 9 Mar 2021 06:12:44 +0000 (UTC) From: Brice Waegeneire To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#46560: [PATCH 0/2] Activate system when switching generations. References: <87czx06ubt.fsf@waegenei.re> <20210304065754.18619-1-brice@waegenei.re> <87blbtd95l.fsf@gnu.org> Date: Tue, 09 Mar 2021 07:12:40 +0100 In-Reply-To: <87blbtd95l.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Mon, 08 Mar 2021 15:15:02 +0100") Message-ID: <87k0qgzwh3.fsf_-_@waegenei.re> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 46560-done Cc: 46560-done@debbugs.gnu.org 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 (-) Hello Ludo, Ludovic Court=C3=A8s writes: > Brice Waegeneire skribis: > >> Brice Waegeneire (2): >> gnu: services: Add activate script to the profile system directory. >> scripts: system: Activate system when switching generations. > > LGTM, thanks! Pushed as df138dc20858725b90ed77be85f3318cbe1be73a and later. I'll close #38884 and will do the same or comment #36855 and #37596 about the new feature. Cheers, - Brice. ------------=_1615270381-14419-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 16 Feb 2021 13:00:55 +0000 Received: from localhost ([127.0.0.1]:39759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBzyI-00013d-Q6 for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:00:55 -0500 Received: from lists.gnu.org ([209.51.188.17]:42692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lBzyG-00011T-Kc for submit@debbugs.gnu.org; Tue, 16 Feb 2021 08:00:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBzyG-0002Rd-Ag for guix-patches@gnu.org; Tue, 16 Feb 2021 08:00:52 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:37045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBzyD-0000HQ-Ia for guix-patches@gnu.org; Tue, 16 Feb 2021 08:00:51 -0500 Received: from localhost (reverse4.evolix.net [31.170.9.129]) (Authenticated sender: brice@waegenei.re) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 55E5C240017 for ; Tue, 16 Feb 2021 13:00:42 +0000 (UTC) From: Brice Waegeneire To: guix-patches@gnu.org Subject: [PATCH 0/2] Activate system when switching generations. Date: Tue, 16 Feb 2021 13:35:46 +0100 Message-ID: <87czx06ubt.fsf@waegenei.re> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=217.70.178.230; envelope-from=brice@waegenei.re; helo=relay10.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-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.6 (-) X-Debbugs-Envelope-To: submit 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.6 (--) Hello, As reported on previous bug report, rolling-back or switching generation doesn't activate the system as a system reconfiguration would do. This is especially problematic when modifying in /run/setuid-programs, as it can't be reverted easily. Also it hinder modification in the activation script since it's not straight forward to revert change made by those script without a functional roll-back mechanism. I'm not sure it's the right approach but at least it work: it add the activate.scm script to the system profile and then load it when switching-generation. This is related to issues: - #37596 and #38884 (they are duplicate) - #36855 a more wider discussion Cheers, - Brice Brice Waegeneire (2): gnu: services: Add activate script to the profile system directory. scripts: system: Activate system when switching generations. gnu/services.scm | 10 +++++++++- guix/scripts/system.scm | 8 ++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) -- 2.30.1 ------------=_1615270381-14419-1--