From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6JwNBJJcLmcQqgAAe85BDQ:P1 (envelope-from ) for ; Fri, 08 Nov 2024 18:46:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6JwNBJJcLmcQqgAAe85BDQ (envelope-from ) for ; Fri, 08 Nov 2024 19:46:42 +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=ARtw+7Z2; dkim=fail ("headers rsa verify failed") header.d=gmx.fr header.s=s31663417 header.b=j8y+tBkb; 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=1731091602; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=j+A13LMfNHbGxe6k1Y7NzSGS5JkWgpCCO5WYKdTIV5U=; b=JLNUsjh9zKuyi92FJX6I0XDUgZm9UZoNrweXOXoqfgdlO/tfl0Xx5NyOh0QqmhLhsDsLhs yzXeDO1NPDRJjL/BFXFbDa8ugNr0g4RQwllxgHq2jYSh4C46PxXxdihq79i1SVJURUvS6f p/Iw5tC7aUEGZEC2bvSb4d8RWBwAbjbteD8Hg+QdyOmLZmVWw+OscMerQf8x0sd8iy/GU0 ObPH3GUtA0FmUVakpNBjMKf3L1jiqtjtCLq7YXMnBFDqYDHs/NoWS1KDVdcanPTQz7Bsem baJPPxxargsolXxhfe7O8P6tUWHxm1b6yHMpD9BW8KZGJNRLRxWKUAqRZWny5g== 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=ARtw+7Z2; dkim=fail ("headers rsa verify failed") header.d=gmx.fr header.s=s31663417 header.b=j8y+tBkb; 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=1731091602; a=rsa-sha256; cv=none; b=I5ISwrsvi9PuTjE14cU/IR5FYb6dKE10Ec2s85H3GrQKU9NytI+LOJKpIl0Bl4t38XnwGf kTN1Vq8SAx+R5BZMaEYjuUIqAG91q2DLpOLdGel7pQYC0nm3RxicOGVZ1Wxmel53krscqF 2oZNcR0C3ZOM2yh5bM/l5HBXryvhf5c0zR086o1sXM7dNPx6axZG4z+go6SVhIpSpmxRR+ nyhLqBge7Rwt9qxY1KEkGT9s75DJ5zmhWhzXEHw+4aDLP9VqkOD0J1Uxx859K/p0bCm4CF eBLnLcSh59nPZ7pT+5NqQqZIDvY646mWadbsZeiOmgSI0dUoKaDOHy0OqVR+3g== 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 8D6F884500 for ; Fri, 08 Nov 2024 19:46:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9Tzg-0003Ex-Rn; Fri, 08 Nov 2024 13:46:04 -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 1t9Tzg-0003Em-26 for guix-patches@gnu.org; Fri, 08 Nov 2024 13:46:04 -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 1t9Tzf-0007jb-Pt for guix-patches@gnu.org; Fri, 08 Nov 2024 13:46:03 -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=j+A13LMfNHbGxe6k1Y7NzSGS5JkWgpCCO5WYKdTIV5U=; b=ARtw+7Z2fv2Vw9/UeOMgKBGpyVPg/00R7kAVahs/0eSCNBoHi9nqxLCilCM3rVE2LJctqPwhMYe8zcFgXlq20W2Km3ZIdlegK7BRxm31umBsrGiDejug48KTX6Aqnmg2ygp65e3rLmICOYQNEnkhOPu4S0gpXKulmDTTcNzapRuZavnrZ2e07VzE+Kck+VtBCothipUhglvfL1iPn2hKZUXL5q86LKDa/YV4z4f+vQAVQUAZ/HApsR8d3/qAM3Bd+n1XJ6DiXK1wa+p1i9Ek6BrLviPIiqzGoyUU0qQ546Jjh+NatvF3YC3b39GJE8B2wDZLv7k/dv+daXHQlavgNQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t9Tzf-0004X8-Ko for guix-patches@gnu.org; Fri, 08 Nov 2024 13:46:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74258] [PATCH 3/3] guix-install.sh: Run the uninstall even if already partially done Resent-From: David Boilleau Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Nov 2024 18:46:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74258 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74258@debbugs.gnu.org Cc: David Boilleau Received: via spool by 74258-submit@debbugs.gnu.org id=B74258.173109150316941 (code B ref 74258); Fri, 08 Nov 2024 18:46:03 +0000 Received: (at 74258) by debbugs.gnu.org; 8 Nov 2024 18:45:03 +0000 Received: from localhost ([127.0.0.1]:52134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9Tyg-0004P4-Lp for submit@debbugs.gnu.org; Fri, 08 Nov 2024 13:45:03 -0500 Received: from mout.gmx.net ([212.227.17.22]:42481) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t9PhW-0000AQ-PQ for 74258@debbugs.gnu.org; Fri, 08 Nov 2024 09:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.fr; s=s31663417; t=1731075057; x=1731679857; i=david_boilleau@gmx.fr; bh=j+A13LMfNHbGxe6k1Y7NzSGS5JkWgpCCO5WYKdTIV5U=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=j8y+tBkbdeujwfXK1vgPDo3KMxkJIKllaUp7bDXr/fh39TRHFlzIfTGxydENm3Mt HWjQAXyqEEY7YhhEDNWW/1d/UwN9E3DNKB1nIdztgGDumQNZo8k/z9+lRQjqMACpz wb1IqkTursdab3z+nt4UmZ1v9AtwK6THhNcpx5ljkK6WClvxVT9YeDVYx2DPOt65Y lG/+b27GghJzB4toAXni/ZCb4NAa+dVcLcFXekEv4yFGpPhJXgmeK5I0zpggK752X 1MDywVJ6UcPybKcHxM2AvhcqpPzVMPDeM14AFcXP1wAzSDUmWR/dF2+KBWBqx5g62 sFvrPKTpraxBKGAuQg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from pms ([88.126.7.20]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MwfWU-1u22O20sX4-00wFfV; Fri, 08 Nov 2024 15:10:57 +0100 Date: Fri, 8 Nov 2024 15:10:24 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Fi6eoLr3KYlCWL9kqTDgXUIEcYNuwkNnAIpD8eSf603si6EluWw GGO6Dcz8Azc18Dfckzf+49w27mScdVvFG8h2aUlnfhTfJAY22CwnJyFf160Hcm7eUqC8ydl TpWwmTpkohpr9DX6/3siGdOGlafF53e8dXdO+HP8CHgbUJ/JM5X67eFv1EVYJtObO0NWFLD LxiCETRcTKbuBFpt215qA== UI-OutboundReport: notjunk:1;M01:P0:kNLQovMOj5I=;46tqSNY/azgDTB+JdU61mD5olWj 3jr6oUkdL077KinSkZ1HV9yMlolQTwynI1YcUikXZEUzlqg/4j5dqr1sX1WVJtvc+QnHNfWid bk/rp6/mVx3OvIJREO+Ynq1yQ4Goe1UPYI09LgWmIPlmS+oUZBdr2QTjNN6v94VaqD2JEc7cL X8QP3/2nVgY8X+xQ9ejm6HBABNuOldkkInL1aYJcW/o+UWApVPUQaah3XZ2HA8dQsMh1cqaFV 0OIyr3pH9XEEyvT77HvTnfoMdXGl26PlOJ1YqCHkIUU9noYrugM7yBUdwf55glDKqmUw2YwQ/ PWRD5HfP0rXGMPPUuO6F0h9pUkUUBvdxXph8/IzFuqodtWWP1rcrNrXTPM8LOChhYS906QT/n ntDf4KRLtf72Y2Avi/ovAkZgWajXBBE9yq7Vr1mJXAhcDorg0XEf43EB04EuaSwUKCYDbz+bp eIWF4HzGaOAbRzykH1CicSm4aX3J21/ulQmGteV58OgLGNqvC1yKqb25kLcjWOKjVC9GjnCCw oxOQX5SyVqcJ8++ywyYuWXo02EgEazJ/4jk1SPNM8zKCbDYap3W8Xd+4nrvYoqVj67PNvsc4r oP0MjcCpX24MUN3IqdddxjPfLnJZXniNQviF+0+/th+cKjQNFD31IiIEPffw2NxWwtq7DQnQh 7ye93OHCtLTcO+b/Y0R8P8vr3hKj6LnKV7GgdlQ7951VvdGH9wu6lw8iuFoo/70ZjPLIm84Wy F3k6EYsHdQnJPNpPAMzbl/4lorhw/gCEmDGDyOucpgvtYwT/QZc3ziMqLrWQYgQ5mCQmcscgS xG8OX67iEZF8hLK7Z2kA0aqdHa6zaiqh4kvcodDSmnxLDsNEwinYsMY+a9h2gGjMnOiAikpZW iNhkgv31bJK1uoQqdm0jzv/d0O++URa39Z0slxqMMRe1jjM1dYIb+mYx3 X-Mailman-Approved-At: Fri, 08 Nov 2024 13:44:56 -0500 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: David Boilleau X-ACL-Warn: , David Boilleau via Guix-patches From: David Boilleau 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-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 2.07 X-Spam-Score: 2.07 X-Migadu-Queue-Id: 8D6F884500 X-TUID: ViQzlT9GktVK Removing users, groups or Systemd units fails if they are already absent, causing the uninstall script to exit. The goal here is to make the uninsta= ll always run entirely, whatever parts are already done. * etc/guix-install.sh (sys_delete_build_user): Test if users and groups ex= ist before deleting them. (sys_delete_guix_daemon): Test if /etc/systemd/system/guix-daemon.service = file exists before removing the matching Systemd unit. Change-Id: Ibffb1f1b39de675542fb8057af21ecaea1b53d4c =2D-- etc/guix-install.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 7fb5ac63c5..f07b2741bb 100755 =2D-- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -451,11 +451,15 @@ sys_create_build_user() sys_delete_build_user() { for i in $(seq -w 1 10); do - userdel -f guixbuilder${i} + if id -u "guixbuilder${i}" &>/dev/null; then + userdel -f guixbuilder${i} + fi done _msg "${INF}delete group guixbuild" - groupdel -f guixbuild + if getent group guixbuild &>/dev/null; then + groupdel -f guixbuild + fi } sys_enable_guix_daemon() @@ -569,12 +573,14 @@ sys_delete_guix_daemon() ;; systemd) - _msg "${INF}disabling guix-daemon" - systemctl disable guix-daemon - _msg "${INF}stopping guix-daemon" - systemctl stop guix-daemon - _msg "${INF}removing guix-daemon" - rm -f /etc/systemd/system/guix-daemon.service + if [ -f /etc/systemd/system/guix-daemon.service ]; then + _msg "${INF}disabling guix-daemon" + systemctl disable guix-daemon + _msg "${INF}stopping guix-daemon" + systemctl stop guix-daemon + _msg "${INF}removing guix-daemon" + rm -f /etc/systemd/system/guix-daemon.service + fi if [ -f /etc/systemd/system/gnu-store.mount ]; then _msg "${INF}disabling gnu-store.mount" =2D- 2.43.0