[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 02/03: service: ‘service->sexp’ exposes pending replacement.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 02/03: service: ‘service->sexp’ exposes pending replacement. |
Date: |
Mon, 1 Apr 2024 17:19:23 -0400 (EDT) |
civodul pushed a commit to branch devel
in repository shepherd.
commit a1fd93a63072e77f3457ae3bb314be7abac70dcd
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Apr 1 23:03:05 2024 +0200
service: ‘service->sexp’ exposes pending replacement.
* modules/shepherd/service.scm (service->sexp): Add ‘pending-replacement?’.
* tests/status-sexp.sh: Adjust accordingly.
---
modules/shepherd/service.scm | 3 ++-
tests/status-sexp.sh | 12 ++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index e358bf1..a03b16e 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -1199,7 +1199,8 @@ clients."
(respawn-delay ,(service-respawn-delay service))
(exit-statuses ,(service-process-exit-statuses service))
(recent-messages ,(service-recent-messages service))
- (log-file ,(service-log-file service))))
+ (log-file ,(service-log-file service))
+ (pending-replacement? ,(->bool (service-replacement service)))))
;;;
diff --git a/tests/status-sexp.sh b/tests/status-sexp.sh
index e095542..32c0fad 100644
--- a/tests/status-sexp.sh
+++ b/tests/status-sexp.sh
@@ -84,7 +84,8 @@ root_service_sexp="
(respawn-delay 0.1)
(exit-statuses ())
(recent-messages ())
- (log-file #f))"
+ (log-file #f)
+ (pending-replacement? #f))"
# Define a helper procedure that resets timestamps in the 'status-changes'
# property to make it easier to compare them.
@@ -127,7 +128,8 @@ $define_reset_timestamps
(respawn-limit (5 . 7)) (respawn-delay 1)
(exit-statuses ())
(recent-messages ())
- (log-file #f))
+ (log-file #f)
+ (pending-replacement? #f))
(service (version 0)
(provides (bar)) (requires (foo))
(respawn? #f) (docstring \"Bar!\")
@@ -140,7 +142,8 @@ $define_reset_timestamps
(respawn-limit (5 . 7)) (respawn-delay 1)
(exit-statuses ())
(recent-messages ())
- (log-file #f)))))))
+ (log-file #f)
+ (pending-replacement? #f)))))))
"
# The 'start' command should return the service sexp on success.
@@ -171,7 +174,8 @@ $define_reset_timestamps
(respawn-limit (5 . 7)) (respawn-delay 1)
(exit-statuses ())
(recent-messages ())
- (log-file #f))))))
+ (log-file #f)
+ (pending-replacement? #f))))))
"
# Make sure we get an 'error' sexp when querying a nonexistent service.