GNU bug report logs -
#74678
[PATCH] services: admin: Improve use of unattended-upgrade reboot? field.
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74678 in the body.
You can then email your comments to 74678 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
:
bug#74678
; Package
guix-patches
.
(Tue, 03 Dec 2024 23:30:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Richard Sent <richard <at> freakingpenguin.com>
:
New bug report received and forwarded. Copy sent to
ludo <at> gnu.org, maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
.
(Tue, 03 Dec 2024 23:30:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Mon, 09 Dec 2024 21:56:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Richard Sent <richard <at> freakingpenguin.com>
:
bug acknowledged by developer.
(Mon, 09 Dec 2024 21:56:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 74678-done <at> debbugs.gnu.org (full text, mbox):
Richard Sent <richard <at> freakingpenguin.com> skribis:
> 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.
Good catch. Applied, thanks!
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 07 Jan 2025 12:24:11 GMT)
Full text and
rfc822 format available.
This bug report was last modified 164 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.