From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 03 18:29:10 2024 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 To: guix-patches@gnu.org Subject: [PATCH] services: admin: Improve use of unattended-upgrade reboot? field. Date: Tue, 3 Dec 2024 18:28:13 -0500 Message-ID: MIME-Version: 1.0 X-Debbugs-Cc: Ludovic Courtès , Maxim Cournoyer 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-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit Cc: Richard Sent 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.4 (--) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 09 16:56:01 2024 Received: (at 74678-done) by debbugs.gnu.org; 9 Dec 2024 21:56:01 +0000 Received: from localhost ([127.0.0.1]:56019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKljU-0002uV-ML for submit@debbugs.gnu.org; Mon, 09 Dec 2024 16:56:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tKljS-0002to-4p for 74678-done@debbugs.gnu.org; Mon, 09 Dec 2024 16:55:58 -0500 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 1tKljM-0004HT-PA; Mon, 09 Dec 2024 16:55:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=XQwsMkevRTP/ZfLkJZzF9mi1HgQuhESqfU5MBOVW+zk=; b=U7Fvnq8uCrJUjKsCsl3X +mgB8izSnusnAI4jcieWZWOX7gUuPhC3Y+wrv6VL7TiT8bAVUbZkD4cGYveF2xSF4bU5BOvfB3ueR DOq94p4Q8lVlxf4eSRtLPpuTAwYXke+8uIg+I3S6G3TQC+sLgXeZLtprzJyEvl4k+VJXlKnSwXde5 cdLgR4652qLsFw3bRqg6lIJHtxEKGWJRT3rpbeZOuf0EwRG/rSfNzGv5d4lNTc0Xk966I3qJ9FZVD F8DjQS/DymeAJwO77S2bl2DifNAMwFr9C6QrdFswRTKdqyU1CHRqBIhWndTB6tKh6FVeRoJLZqj2u IvYvS1iyTwxBkQ==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Richard Sent Subject: Re: [bug#74678] [PATCH] services: admin: Improve use of unattended-upgrade reboot? field. In-Reply-To: (Richard Sent's message of "Tue, 3 Dec 2024 18:28:13 -0500") References: Date: Mon, 09 Dec 2024 22:55:48 +0100 Message-ID: <87bjxkldwb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74678-done Cc: 74678-done@debbugs.gnu.org, Maxim Cournoyer 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: -3.3 (---) Richard Sent skribis: > This ensures the unattended upgrade job successfully reboots regardless o= f the > value for services-to-restart. Previously the mcron service may be restar= ted > 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. Good catch. Applied, thanks! Ludo=E2=80=99. From unknown Sat Jun 21 12:23:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 07 Jan 2025 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator