From dc7b3e56337ee9d8dcd8fe7d5cab71ef536d024f Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 5 Aug 2017 22:16:47 +0100 Subject: services: herd: Fix matching ok responses from shepherd service. Previously the match expression case for a successful response (where error is #f) required that the result component contained a list with a single element. As far as I see when looking at the responses from the shepherd, this is not normally the case. Therefore, to avoid treating successful responses as errors, make the match requirement more permissive, accepting any value. * gnu/services/herd.scm (invoke-action): Change match condition for ok responses. --- gnu/services/herd.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm index f8d60a480..49400aba4 100644 --- a/gnu/services/herd.scm +++ b/gnu/services/herd.scm @@ -146,7 +146,7 @@ result. Otherwise return #f." (force-output sock) (match (read sock) - (('reply ('version 0 _ ...) ('result (result)) ('error #f) + (('reply ('version 0 _ ...) ('result result) ('error #f) ('messages messages)) (for-each display-message messages) (cont result)) -- cgit v1.3 From 0642838b2e9ab2bd988dccb64b9e1130006347bf Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 5 Aug 2017 22:24:18 +0100 Subject: services: herd: Add a stop-service procedure. * gnu/services/herd.scm (stop-service): New procedure. --- gnu/services/herd.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gnu/services') diff --git a/gnu/services/herd.scm b/gnu/services/herd.scm index 49400aba4..e16d51b9d 100644 --- a/gnu/services/herd.scm +++ b/gnu/services/herd.scm @@ -49,7 +49,8 @@ unload-services unload-service load-services - start-service)) + start-service + stop-service)) ;;; Commentary: ;;; @@ -222,6 +223,10 @@ returns a shepherd object." (with-shepherd-action name ('start) result result)) +(define (stop-service name) + (with-shepherd-action name ('stop) result + result)) + ;; Local Variables: ;; eval: (put 'alist-let* 'scheme-indent-function 2) ;; eval: (put 'with-shepherd 'scheme-indent-function 1) -- cgit v1.3