aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorRichard Sent <richard@freakingpenguin.com>2024-12-03 18:28:13 -0500
committerLudovic Courtès <ludo@gnu.org>2024-12-09 23:15:45 +0100
commitb0421cc964ce11c1e43da5ad2a8e31205539737c (patch)
tree47dccd8497c5ec9e9a80c8df9bfce66610f98371 /gnu/services
parent89ed6e80bbc529a79a9ffd1a6b43f1a070751295 (diff)
downloadguix-b0421cc964ce11c1e43da5ad2a8e31205539737c.tar
guix-b0421cc964ce11c1e43da5ad2a8e31205539737c.tar.gz
services: admin: Improve use of unattended-upgrade reboot? field.
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 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/admin.scm10
1 files changed, 6 insertions, 4 deletions
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 @@ which lets you search for packages that provide a given file.")
#$(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.