From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id kL6TJwX7ZmfJQAEAqHPOHw:P1 (envelope-from ) for ; Sat, 21 Dec 2024 17:29:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id kL6TJwX7ZmfJQAEAqHPOHw (envelope-from ) for ; Sat, 21 Dec 2024 18:29:41 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="iumlX6M/"; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=uzC3I+wp; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1734802181; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: 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=sg+tzSoNpo4NreLrmz4j1tsSAkk4dcN12IGGjeWhksU=; b=hzzs0iKGqM2+QjjJL4/w7jiK/or5U6Pfdj/hNn4dwYErTdn5zXHbUL9GF0i9PzyDu9oc8h nyECMjhjpOFI8yOJi4a96+zayxNLRKzIFR3Pf+qtaugCjeAVraW+2G/lYavd5Q2p9wzDKJ e4tQTw2HmBOnI4TvQZBi6dZ9QeIbmqZQG1xi1C+CNaRsYnDnI4+SubQouMmtrs1dt9V93+ bUByU5IPt6t/UjO9+1PtMvaF94QOJgm8DDszoaT/8BxnsUoBsG+g0h8Od8C9CYXY4dm8Hk mUNhYafgqY6DuPqs9wgAafigXqEjsCYHuqItFTkAAq0k5Vo2thGomX3+Lb33xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b="iumlX6M/"; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=uzC3I+wp; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1734802181; a=rsa-sha256; cv=none; b=jLeakejaspuNMjekoSyqDB0GfliQ88TGAZjsNWYr3NR0k3+7B6b4/oc3IrL4+Cjrz/vfJU Fcy3eg3BCo/sxA4Q3bGlMJoQrO7eDg+FDn1opIUbsi0PiKk9t39okIJuIKm7XegOwcQ4vw LPhm4ApEEqGqHHI9hODt6jPiFRcCxv3iNaynRUaRWIADDDHPKrw3OuK+miHEwIIwEDBcVL ZjLwxwALQCH2qt4OupBsbJLCv8jf3JpKrc0XEpoe164HqDLpvOtnWa07Xk+oUnYbduxe7k QT8IdBA5q9SP89ca+wp7UPBM8yEuitBLCG3gvKpWvHcujxn9LsEafuPMY6j5DQ== 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 32BB81C10D for ; Sat, 21 Dec 2024 18:29:41 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tP2vZ-0005Ri-8t; Sat, 21 Dec 2024 12:06:09 -0500 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 1tP2vW-0005R5-N4 for guix-patches@gnu.org; Sat, 21 Dec 2024 12:06:06 -0500 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 1tP2vV-0003PR-Fk for guix-patches@gnu.org; Sat, 21 Dec 2024 12:06:06 -0500 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=sg+tzSoNpo4NreLrmz4j1tsSAkk4dcN12IGGjeWhksU=; b=iumlX6M/A6AZfC9j7emSLove8F3q2w9H8hH/RbmECHpNOpeTCOJv8X+3cyNQ2K6z1dAedtjGywNfEMNcs/BU786PPhtbqgvWjK7jSCNu7VV4jfTDabR+8+V0XT80rYQh84ihWQt421XiNO32m4ijGlqcfwNgtlJzJwqxcPfH01dBs73hGSRJAXsa9Mjrn7NldY/u3uCeVT4RQ8eRwlt+wqPKTIGehHzzLCij32iLViDzwCDxg4amZX5TbeqRkK9C43PShE5tXY4IVJuHTyxVG7Tm5r5d940i/LXpArFOlhSvEd5T7r5+tfQTYv/1Nun0Fxmwyi+kVa3/zKKqiFaCWg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tP2vV-0005Rd-9l for guix-patches@gnu.org; Sat, 21 Dec 2024 12:06:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75010] [PATCH 6/7] gnu: machine: ssh: Roll-back on failure. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 21 Dec 2024 17:06:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75010 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75010@debbugs.gnu.org Received: via spool by 75010-submit@debbugs.gnu.org id=B75010.173480071720815 (code B ref 75010); Sat, 21 Dec 2024 17:06:05 +0000 Received: (at 75010) by debbugs.gnu.org; 21 Dec 2024 17:05:17 +0000 Received: from localhost ([127.0.0.1]:47525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tP2ui-0005PZ-Bh for submit@debbugs.gnu.org; Sat, 21 Dec 2024 12:05:16 -0500 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:38121 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tP2ud-0005I2-10 for 75010@debbugs.gnu.org; Sat, 21 Dec 2024 12:05:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1734800700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sg+tzSoNpo4NreLrmz4j1tsSAkk4dcN12IGGjeWhksU=; b=uzC3I+wp5im80GUQLs+gLQN8j9bLPSfA7yLGIRK0nG2a0pDr7Rtllwys9+yHZmwbQmE7G5 4LJ2sLdABhcIWtYSf+Mhtg7cvI7eGBDwqSYqNco4temizhmkUreYQ78SKAlqiY9EVpagtT O/j0sPg0wfNFZo0HhzQEEwv5B1ICfkHVRfn8tm4XAl6DRXUbTpq2IXdrIIFiLypdOVceXW Oo6BKim9eRIpjkpoenUjX9bPrfK5saMkgZXfNmaIywZcmLvcumHnzgPLR65XI8v7Pu51hF 4Wf7A1+lJbpcjSFnQipFxAfqkQJG9Sl7NDhiHvDvugqSbwBjfaIxiCmKFSDFgQ== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 981c04c1 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <75010@debbugs.gnu.org>; Sat, 21 Dec 2024 17:05:00 +0000 (UTC) Date: Sat, 21 Dec 2024 18:04:10 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -6.02 X-Spam-Score: -6.02 X-Migadu-Queue-Id: 32BB81C10D X-Migadu-Scanner: mx10.migadu.com X-TUID: G2ls1t9l8E6u This restores the roll-back behaviour which was disabled in 2885c35. * gnu/machine/ssh.scm (deploy-managed-host): Use roll-back-machine. Change-Id: I8636347541ee1e4e30da15dd43455329a46c3bdb --- gnu/machine/ssh.scm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index b954620b69..9cc9c8f099 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -512,7 +512,8 @@ (define (deploy-managed-host machine) (menu-entries (map boot-parameters->menu-entry boot-parameters)) (bootloader-configuration (operating-system-bootloader os)) (bootcfg (operating-system-bootcfg os menu-entries))) - (define-syntax-rule (eval/error-handling condition handler ...) + (define-syntax-rule (eval/error-handling condition store + handler ...) ;; Return a wrapper around EVAL such that HANDLER is evaluated if an ;; exception is raised. (lambda (exp) @@ -524,7 +525,7 @@ (define (deploy-managed-host machine) store))))) (mbegin %store-monad - (switch-to-system (eval/error-handling c + (switch-to-system (eval/error-handling c store (raise (formatted-message (G_ "\ failed to switch systems while deploying '~a':~%~{~s ~}") @@ -535,13 +536,19 @@ (define (deploy-managed-host machine) (%current-target-system #f)) (mbegin %store-monad (upgrade-shepherd-services - (eval/error-handling c + (eval/error-handling c store + (info (G_ "rolling back ~a...~%") host) + (run-with-store store (roll-back-machine machine) + #:system system) (warning (G_ "\ an error occurred while upgrading services on '~a':~%~{~s ~}~%") host (inferior-exception-arguments c))) os) (install-bootloader - (eval/error-handling c + (eval/error-handling c store + (info (G_ "rolling back ~a...~%") host) + (run-with-store store (roll-back-machine machine) + #:system system) (raise (formatted-message (G_ "\ failed to install bootloader on '~a':~%~{~s ~}~%") -- 2.45.2