[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 02/02: service: Remove 'enforce' methods.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 02/02: service: Remove 'enforce' methods. |
Date: |
Sun, 19 Mar 2023 17:27:49 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit d569e920a39f77ef4f7c3f9995a4ff8b4509481f
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Mar 19 22:07:06 2023 +0100
service: Remove 'enforce' methods.
* modules/shepherd/service.scm (enforce): Remove.
* modules/shepherd.scm (process-command): Remove special treatment of
'enforce' action.
---
modules/shepherd.scm | 1 -
modules/shepherd/service.scm | 15 +--------------
2 files changed, 1 insertion(+), 15 deletions(-)
diff --git a/modules/shepherd.scm b/modules/shepherd.scm
index 25863ea..29225e2 100644
--- a/modules/shepherd.scm
+++ b/modules/shepherd.scm
@@ -496,7 +496,6 @@ already ~a threads running, disabling 'signalfd' support")
(case the-action
((start) (apply start service-symbol args))
((stop) (apply stop service-symbol args))
- ((enforce) (apply enforce service-symbol args))
;; Actions which have the semantics of `action' are
;; handled there.
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 1c837de..966b797 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -68,7 +68,6 @@
start-in-the-background
stop
action
- enforce
doc
conflicts-with
conflicts-with-running
@@ -921,14 +920,6 @@ is not already running, and will return SERVICE's
canonical name in a list."
(define-method (conflicts-with-running (obj <service>))
(filter running? (conflicts-with obj)))
-;; Start OBJ, but first kill all services which conflict with it.
-;; FIXME-CRITICAL: Conflicts of indirect dependencies. For this, we
-;; seem to need a similar solution like launch-service.
-;; FIXME: This should rather be removed and added cleanly later.
-(define-method (enforce (obj <service>) . args)
- (for-each stop (conflicts-with-running obj))
- (apply start obj args))
-
(define (service->sexp service)
"Return a representation of SERVICE as an sexp meant to be consumed by
clients."
@@ -1090,7 +1081,7 @@ service state and to send requests to the service
monitor."
(define (launch-service name proc args)
"Try to start (with PROC) a service providing NAME; return #f on failure.
-Used by `start' and `enforce'."
+Used by `start'."
(match (lookup-services name)
(()
(raise (condition (&missing-service-error (name name)))))
@@ -1106,10 +1097,6 @@ Used by `start' and `enforce'."
(define-method (start (obj <symbol>) . args)
(launch-service obj start args))
-;; Enforcing by name. FIXME: Should be removed and added cleanly later.
-(define-method (enforce (obj <symbol>) . args)
- (launch-service obj enforce args))
-
;; Stopping by name.
(define-method (stop (obj <symbol>) . args)
(let ((which (find (negate stopped?) (lookup-services obj))))