guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 01/05: service: 'service->sexp' always emits 'one-shot?' and


From: Ludovic Courtès
Subject: [shepherd] 01/05: service: 'service->sexp' always emits 'one-shot?' and 'transient?'.
Date: Sun, 7 May 2023 17:18:02 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit fa510f1a0135ba016e2f59e54fc5dbad9a459dd2
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat May 6 22:44:03 2023 +0200

    service: 'service->sexp' always emits 'one-shot?' and 'transient?'.
    
    In Guix, the (gnu services herd) client would check whether 'transient?
    is present to distinguish between shepherd >= 0.9.1 and earlier
    versions.  This lifts the ambiguity.
    
    * modules/shepherd/service.scm (service->sexp): Emit the 'one-shot?' and
    'transient?' properties unconditionally.
    * tests/status-sexp.sh: Adjust accordingly.
---
 modules/shepherd/service.scm |  8 ++------
 tests/status-sexp.sh         | 10 +++++++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index bcc10cd..fa1926c 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -1047,12 +1047,8 @@ clients."
             (status-changes ,(service-status-changes service))
             (startup-failures ,(service-startup-failures service))
             (status ,(service-status service))
-            ,@(if (one-shot-service? service)
-                  '((one-shot? #t))
-                  '())
-            ,@(if (transient-service? service)
-                  '((transient? #t))
-                  '())))
+            (one-shot? ,(one-shot-service? service))
+            (transient? ,(transient-service? service))))
 
 
 ;;;
diff --git a/tests/status-sexp.sh b/tests/status-sexp.sh
index dc6717f..34b062c 100644
--- a/tests/status-sexp.sh
+++ b/tests/status-sexp.sh
@@ -75,7 +75,9 @@ root_service_sexp="
       (last-respawns ())
       (status-changes ((running . 0) (starting . 0)))
       (startup-failures ())
-      (status running))"
+      (status running)
+      (one-shot? #f)
+      (transient? #f))"
 
 # Define a helper procedure that resets timestamps in the 'status-changes'
 # property to make it easier to compare them.
@@ -113,7 +115,8 @@ $define_reset_timestamps
               (last-respawns ())
                (status-changes ((running . 0) (starting . 0)))
                (startup-failures ())
-               (status running))
+               (status running)
+               (one-shot? #f) (transient? #f))
             (service (version 0)
               (provides (bar)) (requires (foo))
               (respawn? #f) (docstring \"Bar!\")
@@ -121,7 +124,8 @@ $define_reset_timestamps
               (last-respawns ())
                (status-changes ())
                (startup-failures ())
-               (status stopped)))))))
+               (status stopped)
+               (one-shot? #f) (transient? #f)))))))
 "
 
 # Make sure we get an 'error' sexp when querying a nonexistent service.



reply via email to

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