civodul pushed a commit to branch master
in repository shepherd.

commit 5ab8cbc9bcfce586a5389ad95a65f011d02bd289
Author: Ludovic Courtès <[email protected]>
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 <[email protected]>
    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