diff options
| author | Richard Sent <richard@freakingpenguin.com> | 2024-12-03 18:28:13 -0500 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-12-09 23:15:45 +0100 |
| commit | b0421cc964ce11c1e43da5ad2a8e31205539737c (patch) | |
| tree | 47dccd8497c5ec9e9a80c8df9bfce66610f98371 /gnu/services/admin.scm | |
| parent | 89ed6e80bbc529a79a9ffd1a6b43f1a070751295 (diff) | |
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/admin.scm')
| -rw-r--r-- | gnu/services/admin.scm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 4882883878a..24ff659a01b 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.") | |||
| 512 | #$(string-append (number->string expiration) | 512 | #$(string-append (number->string expiration) |
| 513 | "s"))) | 513 | "s"))) |
| 514 | 514 | ||
| 515 | (format #t "~a restarting services...~%" (timestamp)) | 515 | (unless #$reboot? |
| 516 | (for-each restart-service '#$services) | 516 | ;; Rebooting effectively restarts services anyway and execution |
| 517 | ;; would be halted here if mcron is restarted. | ||
| 518 | (format #t "~a restarting services...~%" (timestamp)) | ||
| 519 | (for-each restart-service '#$services)) | ||
| 517 | 520 | ||
| 518 | ;; XXX: If 'mcron' has been restarted, perhaps this isn't | 521 | ;; XXX: If 'mcron' has been restarted, this is not reached. |
| 519 | ;; reached. | ||
| 520 | (format #t "~a upgrade complete~%" (timestamp)) | 522 | (format #t "~a upgrade complete~%" (timestamp)) |
| 521 | 523 | ||
| 522 | ;; Stopping the root shepherd service triggers a reboot. | 524 | ;; Stopping the root shepherd service triggers a reboot. |
