From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carlo Zancanaro Subject: bug#22039: [PATCH] 'guix system reconfigure' must start/restart/stop services Date: Sun, 26 Aug 2018 22:15:03 +1000 Message-ID: <87tvnhxr20.fsf@zancanaro.id.au> References: <874mg6rsjl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fttxf-000503-GB for bug-guix@gnu.org; Sun, 26 Aug 2018 08:16:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fttxe-00015P-Jg for bug-guix@gnu.org; Sun, 26 Aug 2018 08:16:07 -0400 In-Reply-To: <874mg6rsjl.fsf@gnu.org> Sender: "Debbugs-submit" Resent-Message-ID: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 22039@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; format=flowed 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. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-services-Load-all-services-on-reconfigure-not-ju.patch Content-Transfer-Encoding: quoted-printable From=20162bd298563201ebf6eda87d46ae1b64671397da Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro 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. =2D-- 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 =2D-- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2018 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2017 Cl=C3=A9ment Lassieur +;;; Copyright =C2=A9 2018 Carlo Zancanaro ;;; ;;; This file is part of GNU Guix. ;;; @@ -338,20 +339,6 @@ needs to be loaded." (shepherd-service-lookup-procedure target shepherd-service-provision)) =20 =2D (define lookup-live =2D (shepherd-service-lookup-procedure live =2D live-service-provision)) =2D =2D (define (running? service) =2D (and=3D> (lookup-live (shepherd-service-canonical-name service)) =2D live-service-running)) =2D =2D (define (stopped service) =2D (match (lookup-live (shepherd-service-canonical-name service)) =2D (#f #f) =2D (service (and (not (live-service-running service)) =2D service)))) =2D (define live-service-dependents (shepherd-service-back-edges live #:provision live-service-provision @@ -363,14 +350,12 @@ needs to be loaded." (_ #f))) =20 (define to-load =2D ;; Only load services that are either new or currently stopped. =2D (remove running? target)) + ;; Load all of the new services. + target) =20 (define to-unload =2D ;; Unload services that are (1) no longer required, or (2) are in TO= -LOAD. =2D (remove essential? =2D (append (filter obsolete? live) =2D (filter-map stopped to-load)))) + ;; Unload services that are no longer required. + (remove essential? (filter obsolete? live))) =20 (values to-unload to-load)) =20 =2D-=20 2.18.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE1lpncq7JnOkt+LaeqdyPv9awIbwFAluCmccACgkQqdyPv9aw IbyvRRAApCdWUbxl9KkYNo0NnxHpjEXn0LPOqQzwrWHE9LBoIPIVQ4Ri7mcCYHvl uIz2WZ+08A88vOHIXoVxI1xpsWco4MU+NM+jysZatDqrjt1mUJPEyqQUcCB0o0QV NMjLXzyV70HYQjdFoIkq8xZluUYo+Ar8oE04Ey2zsy7+RV2GyV2QqNOW35ki/il7 q5NrJujR5XYVz+SOzKL+K9yYYfehh53CHG0Uy24wXfrStHQehrWChRzUEEN4uEwF xrqcOOq4Txnn92b7TCuqA0vtJ+A7L5PSFS47qhJo0+OcNC3OhApQXWnHXRhby4S3 3ZlZdyGc/amZspFFDD/zttWmfL4StPC/HzH54cpTJwC/qlOyk9heS6xgJU+819f+ zJDWsvMTkeqJ782Yoz81SgcgML8I3eQWsXkWyaoFM4iPOjrfVuIiPhEr4BQEibq2 LGdG7rFE0ZKFBmkwo7QyB1AqhLuAPheQY1mlbIQ41BneccWULmoA3uy5Zc9i69E0 P5zzogQL9QettdpDz2vXmOwjstipbQSP1EuW/x1h8GuCdy43oxORE6EvqjZkHL3A GheEJZUv1vqtWGpPn8T55cTiD0USpqhjSdGwrkxkl04KrT+Jkywwju+gswknot9G z9jZ0c+Fna2VIo/Wp4t7eDOKOehdReG/0yudWeFpEgnOKlR4/JE= =fVbo -----END PGP SIGNATURE----- --==-=-=--