[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
- [shepherd] branch master updated (69f93a6 -> b79b9a3), Ludovic Courtès, 2023/04/27
- [shepherd] 04/10: doc: Clarify upfront what the config file does., Ludovic Courtès, 2023/04/27
- [shepherd] 02/10: service: 'register-services' now takes a list of services., Ludovic Courtès, 2023/04/27
- [shepherd] 03/10: tests: Update for new 'register-services' interface., Ludovic Courtès, 2023/04/27
- [shepherd] 07/10: service: 'shutdown-services' does not stop 'root'.,
Ludovic Courtès <=
- [shepherd] 01/10: service: Rename 'make-actions' to 'actions'., Ludovic Courtès, 2023/04/27
- [shepherd] 05/10: doc: Update user services example., Ludovic Courtès, 2023/04/27
- [shepherd] 06/10: herd: Add 'graph' action., Ludovic Courtès, 2023/04/27
- [shepherd] 08/10: service: Localize help message of the 'root' service., Ludovic Courtès, 2023/04/27
- [shepherd] 10/10: repl: Update calls to deprecated 'start'., Ludovic Courtès, 2023/04/27
- [shepherd] 09/10: herd: Use 'strftime' rather than 'date->string' for 'status' output., Ludovic Courtès, 2023/04/27