guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 01/01: service: Let users invoke actions even on services tha


From: Ludovic Courtès
Subject: [shepherd] 01/01: service: Let users invoke actions even on services that don't run.
Date: Thu, 12 Jul 2018 18:37:51 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 5ab8cbc9bcfce586a5389ad95a65f011d02bd289
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jul 13 00:35:56 2018 +0200

    service: Let users invoke actions even on services that don't run.
    
    Suggested by Clément Lassieur <address@hidden>
    in <https://bugs.gnu.org/32128>.
    
    * modules/shepherd/service.scm (action): Call PROC unconditionally.
---
 modules/shepherd/service.scm | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 93d3779..5653388 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -428,20 +428,11 @@ wire."
   (let ((proc (or (and=> (lookup-action obj the-action)
                          action-procedure)
                  default-action)))
-    ;; Calling default-action will be allowed even when the service is
-    ;; not running, as it provides generally useful functionality and
-    ;; information.
-    ;; FIXME: Why should the user-implementations not be allowed to be
-    ;; called this way?
+    ;; Invoking THE-ACTION is allowed even when the service is not running, as
+    ;; it provides generally useful functionality and information.
     (catch #t
       (lambda ()
-        (cond ((eq? proc default-action)
-               (apply default-action obj args))
-              ((not (running? obj))
-               (local-output "Service ~a is not running." (canonical-name obj))
-               #f)
-              (else
-               (apply proc (slot-ref obj 'running) args))))
+        (apply proc (slot-ref obj 'running) args))
       (lambda (key . args)
         ;; Special case: 'root' may quit.
         (and (eq? root-service obj)



reply via email to

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