When the next release of the Shepherd is made (including commit 9ec5c0000e9a45441417a6ee4138cdcbf1b1f2b2) we should have the capability to resolve this ticket.

Attached is my proposed patch from the Guix side. I have tested it on my machine by grafting the Shepherd with the appropriate patch and it seems to work as expected.

I tested it by changing the substitute-urls in my guix-daemon configuration. The output of `ps aux | grep guix-daemon` after `guix system reconfigure` showed the substitute-urls were unchanged. After `herd restart guix-daemon` the updated substitute-urls appeared in `ps aux | grep guix-daemon`. I did not need to reboot my system.

One possible improvement would be to print out the services that need to be restarted to be upgraded.

From 162bd298563201ebf6eda87d46ae1b64671397da Mon Sep 17 00:00:00 2001
From: Carlo Zancanaro <ca...@zancanaro.id.au>
Date: Sun, 26 Aug 2018 21:54:14 +1000
Subject: [PATCH] gnu: services: Load all services on reconfigure, not just
 stopped ones

* gnu/services/shepherd.scm (shepherd-service-upgrade): Remove checks for
running services.
---
 gnu/services/shepherd.scm | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 4cd224984..efeb82c86 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <l...@gnu.org>
 ;;; Copyright © 2017 Clément Lassieur <clem...@lassieur.org>
+;;; Copyright © 2018 Carlo Zancanaro <ca...@zancanaro.id.au>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -338,20 +339,6 @@ needs to be loaded."
     (shepherd-service-lookup-procedure target
                                        shepherd-service-provision))
 
-  (define lookup-live
-    (shepherd-service-lookup-procedure live
-                                       live-service-provision))
-
-  (define (running? service)
-    (and=> (lookup-live (shepherd-service-canonical-name service))
-           live-service-running))
-
-  (define (stopped service)
-    (match (lookup-live (shepherd-service-canonical-name service))
-      (#f #f)
-      (service (and (not (live-service-running service))
-                    service))))
-
   (define live-service-dependents
     (shepherd-service-back-edges live
                                  #:provision live-service-provision
@@ -363,14 +350,12 @@ needs to be loaded."
       (_  #f)))
 
   (define to-load
-    ;; Only load services that are either new or currently stopped.
-    (remove running? target))
+    ;; Load all of the new services.
+    target)
 
   (define to-unload
-    ;; Unload services that are (1) no longer required, or (2) are in TO-LOAD.
-    (remove essential?
-            (append (filter obsolete? live)
-                    (filter-map stopped to-load))))
+    ;; Unload services that are no longer required.
+    (remove essential? (filter obsolete? live)))
 
   (values to-unload to-load))
 
-- 
2.18.0

Attachment: signature.asc
Description: PGP signature

Reply via email to