From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id WNwoL5mUT2fHBQAA62LTzQ:P1 (envelope-from ) for ; Tue, 03 Dec 2024 23:30:33 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id WNwoL5mUT2fHBQAA62LTzQ (envelope-from ) for ; Wed, 04 Dec 2024 00:30:33 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=agvy9TmN; dkim=fail ("headers rsa verify failed") header.d=freakingpenguin.com header.s=x header.b=i64ABmK9; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733268633; a=rsa-sha256; cv=none; b=RiG2IqI8/xaKTSEYeH51tv3I4ZM31hOyaOXlqqRbzKMVHlIC55Zp32kdDLMzjKffRketso kWzm629/MhiETcPtml0mcNHl2v/y2kvu/3ucoGZ0Ogb8N3CgYCHNtlmH1P6c8ZMZkgtR6E 3KbSI9DktGlHTBQ2uQ0QFxzRn+6MHicB3BGVNdGRcSdhSMRDZCSPIzvc+AynX0e5v8zH8Z 6mlRML9moQZlOgoD0/u6iaVH183hag9NJv3FOssykv73UGqMkAIiApctiFOeJB8mOIv2a1 l8RzxCZamGsTeAGXxTsIIsrAP9WgyM27hW/exr2J+cvnELkJMGSwGjVMHojbzw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=agvy9TmN; dkim=fail ("headers rsa verify failed") header.d=freakingpenguin.com header.s=x header.b=i64ABmK9; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733268633; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=XCIR8x+HQtjoy4oYpovix/oR241P+oBUZ/8WnIRTL5M=; b=Mh2CGu/gnrPVrTFGpofldVrSIlo7oM2NG8O8BTiW7cx149a0ARQqwEN4YXbAvZQajQN9YI TagpcgvkKCV2WdD1gS9pFvS95yRBfLQMWBHN/pR+UFrGU85iage0t4NX8I5PhogK6hH3nX v17nLI5YNUtgyK+kGne/DuWZ30cBLSSrakKbQ+Mhp9eaRHjBbcpWJR/o6ruR9lxXKsProI 4OFbp556oS27WAKcmssrqyZ7vQDIotfMQuZGii6OXbnGzEAaH0gNEq7Lg9n0QUATeLZZxJ mG53+SbKK4YxarN4q0ZF+4ym1pT54cIDFwXrBZcZHZRUHMbrDRQk+rqg9gZv4g== 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 2D7366331F for ; Wed, 04 Dec 2024 00:30:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tIcLG-00029s-9S; Tue, 03 Dec 2024 18:30:06 -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 1tIcLE-00027m-Cs for guix-patches@gnu.org; Tue, 03 Dec 2024 18:30: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 1tIcLD-0005Ys-Cy; Tue, 03 Dec 2024 18:30: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:Date:From:To:Subject; bh=XCIR8x+HQtjoy4oYpovix/oR241P+oBUZ/8WnIRTL5M=; b=agvy9TmNmi+8L7rQPk7UupbSpUmpq9TxKCwdoh4vxDvOnIQ0xkn7lkyc0n7GvX9bAkOx2Xa4MIyA00h61m2mXZQhbdhyzJS5ufYAsfiSfmHG2uIlRCABRaYQ2xnSSsNIazYrTm01z9EHIgzkwR7y5UM8ab7efoKE+33h9IUpzLQ4iCeUOUGYaJJBj6O9ZoP3ynk8ffm8t5Swkyaxn0c7KLNt2IAoNbGvvG5udYFVtRg2sy+jQIciRut6BOqs9dmPC6SbbSUuAjd6vGIf2PjgG4Ibu0VV3FHvMyQq2nY0RjN6GG/HbfiXtnmzTla/u8/Q2yJHRBVOiEDd8DqK4URP9A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tIcLD-0002K2-15; Tue, 03 Dec 2024 18:30:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74678] [PATCH] services: admin: Improve use of unattended-upgrade reboot? field. Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 03 Dec 2024 23:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74678 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74678@debbugs.gnu.org Cc: Richard Sent , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Maxim Cournoyer Received: via spool by submit@debbugs.gnu.org id=B.17332685508819 (code B ref -1); Tue, 03 Dec 2024 23:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2024 23:29:10 +0000 Received: from localhost ([127.0.0.1]:33333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIcKM-0002IA-24 for submit@debbugs.gnu.org; Tue, 03 Dec 2024 18:29:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:47522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tIcKH-0002I0-H8 for submit@debbugs.gnu.org; Tue, 03 Dec 2024 18:29:08 -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 1tIcKH-0001sx-6g for guix-patches@gnu.org; Tue, 03 Dec 2024 18:29:05 -0500 Received: from mail-108-mta38.mxroute.com ([136.175.108.38]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIcKE-00059f-Fr for guix-patches@gnu.org; Tue, 03 Dec 2024 18:29:04 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta38.mxroute.com (ZoneMTA) with ESMTPSA id 1938edafef60003e01.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Tue, 03 Dec 2024 23:28:57 +0000 X-Zone-Loop: 9ebb9cc28f77e531122f82804baf52f1cbd7abbb13d2 X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XCIR8x+HQtjoy4oYpovix/oR241P+oBUZ/8WnIRTL5M=; b=i64ABmK9/bIZrUMFcg8BOv5Q89 2FYu4Hf08XWoD+zeG3JpZdNYq5WAF5tHPLyOQHgxp5xdvrgqhim7nS5f4HockKcUJP00ps4c9nIw3 u4VeQy8wTD9gMbDo4lfjMJQbFrijFWZVL5AJRG6rBzVrpIcS/9Ar5TXLdrOYSFuQ3rWttQP6+Eg28 EG4VR6/HGlS22YD17oNncyRb0ZE6527g5Oz+Ek6xxPgNk/+GGjBArts6ynafDUaxyxPoYx8LNBwKZ W9M03ZyV15iumZr8D3AeYvqEpftGQT622gxfQuIPIeWZQaM0Hzco9+qmiPHxPg8vJeUqh2UJ6D/N5 fSmrzXnw==; From: Richard Sent Date: Tue, 3 Dec 2024 18:28:13 -0500 Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.38; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta38.mxroute.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.42 X-Spam-Score: -0.42 X-Migadu-Queue-Id: 2D7366331F X-Migadu-Scanner: mx12.migadu.com X-TUID: f7H7AHaC04U1 This ensures the unattended upgrade job successfully reboots regardless of the value for services-to-restart. Previously the mcron service may be restarted which would halt script execution before the system rebooted. * gnu/services/admin.scm (unattended-upgrade-mcron-jobs): Do not restart services when reboot? is #t. * doc/guix.texi (Unattended Upgrades): Document it. Change-Id: I8e486a764ec1dc5c3090130cc447a0cc3f5a2e00 --- Hi all, I noticed my server would not reboot automatically until I set services-to-restart to '() (default value: '(mcron)). This patch should make unattended-upgrade easier to use for those who don't want to dive into the code. doc/guix.texi | 4 ++++ gnu/services/admin.scm | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 26488b41c8..5f4fded753 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -23268,6 +23268,10 @@ Unattended Upgrades This field specifies whether the system should reboot after completing an unattended upgrade. +When @code{reboot?} is @code{#t}, services are not restarted before +rebooting. This means that the value for @code{services-to-restart} is +ignored. The updated services will be started after the system reboots. + @item @code{services-to-restart} (default: @code{'(mcron)}) This field specifies the Shepherd services to restart when the upgrade completes. diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 4882883878..24ff659a01 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -512,11 +512,13 @@ (define (unattended-upgrade-mcron-jobs config) #$(string-append (number->string expiration) "s"))) - (format #t "~a restarting services...~%" (timestamp)) - (for-each restart-service '#$services) + (unless #$reboot? + ;; Rebooting effectively restarts services anyway and execution + ;; would be halted here if mcron is restarted. + (format #t "~a restarting services...~%" (timestamp)) + (for-each restart-service '#$services)) - ;; XXX: If 'mcron' has been restarted, perhaps this isn't - ;; reached. + ;; XXX: If 'mcron' has been restarted, this is not reached. (format #t "~a upgrade complete~%" (timestamp)) ;; Stopping the root shepherd service triggers a reboot. base-commit: 8a28ba76126cbbd2a6d61e864f576e7a7bd7a763 -- 2.46.0