From b0421cc964ce11c1e43da5ad2a8e31205539737c Mon Sep 17 00:00:00 2001 From: Richard Sent Date: Tue, 3 Dec 2024 18:28:13 -0500 Subject: services: admin: Improve use of unattended-upgrade reboot? field. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- gnu/services/admin.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gnu/services') 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. -- cgit v1.2.3