guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[shepherd] 07/10: service: 'shutdown-services' does not stop 'root'.


From: Ludovic Courtès
Subject: [shepherd] 07/10: service: 'shutdown-services' does not stop 'root'.
Date: Thu, 27 Apr 2023 10:16:36 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit db7879079152166a99b1bc004c6607f78c6c2d26
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Apr 27 14:48:54 2023 +0200

    service: 'shutdown-services' does not stop 'root'.
    
    * modules/shepherd/service.scm (service-controller): Remove
    'notify-termination' handler.
    (shutdown-services): Do not call 'stop-service' on ROOT-SERVICE.
    (root-service): Remove 'notify-termination' message.
---
 modules/shepherd/service.scm | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 3467bbb..19f8385 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -546,11 +546,6 @@ denoting what the service provides."
              (respawns '())
              (failures (ring-buffer %max-recorded-startup-failures))))
 
-      ('notify-termination                        ;no reply
-       (loop (status 'stopped)
-             (changes (update-status-changes 'stopped))
-             (value #f)))
-
       (('handle-termination pid exit-status)      ;no reply
        ;; Handle premature termination of this service's process, possibly by
        ;; respawning it, unless STATUS is 'stopping' or 'stopped' or PID
@@ -2629,7 +2624,8 @@ Used by `start'."
   ;; suspending via (@ (fibers) sleep), 'spawn-command', or similar.
   (for-each
    (lambda (service)
-     (when (service-running? service)
+     (when (and (service-running? service)
+                (not (eq? service root-service)))
        (stop-service service)))
    (service-list)))
 
@@ -2661,11 +2657,6 @@ where prctl/PR_SET_CHILD_SUBREAPER is unsupported."
              #t)
     #:stop (lambda (unused . args)
             (local-output (l10n "Exiting shepherd..."))
-
-            ;; Prevent that we try to stop ourself again.
-            (put-message (service-control root-service)
-                          'notify-termination)
-
              (shutdown-services)
             (quit))
     ;; All actions here need to take care that they do not invoke any



reply via email to

[Prev in Thread] Current Thread [Next in Thread]