guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 02/02: herd: "herd status SERVICE" reports whether the servic


From: Ludovic Courtès
Subject: [shepherd] 02/02: herd: "herd status SERVICE" reports whether the service is transient.
Date: Sat, 9 Apr 2022 16:58:35 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 0e96e4c234364ea8e6c808faaa4c0593a59c5bac
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Apr 9 22:55:48 2022 +0200

    herd: "herd status SERVICE" reports whether the service is transient.
    
    * modules/shepherd/scripts/herd.scm (display-service-status): Report
    it if SERVICE is transient.
    * tests/transient.sh: Test it.
---
 modules/shepherd/scripts/herd.scm | 8 +++++---
 tests/transient.sh                | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/shepherd/scripts/herd.scm 
b/modules/shepherd/scripts/herd.scm
index 04e3268..9e22b70 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -1,5 +1,5 @@
 ;; herd.scm -- The program to herd the Shepherd.
-;; Copyright (C) 2013, 2014, 2016, 2018, 2019, 2021 Ludovic Courtès 
<ludo@gnu.org>
+;; Copyright (C) 2013-2014, 2016, 2018-2019, 2021-2022 Ludovic Courtès 
<ludo@gnu.org>
 ;; Copyright (C) 2002, 2003 Wolfgang Jährling <wolfgang@pro-linux.de>
 ;;
 ;; This file is part of the GNU Shepherd.
@@ -92,10 +92,12 @@ of pairs."
   (match service
     (('service ('version 0 _ ...) properties ...)
      (alist-let* properties (provides requires running respawn? enabled?
-                             conflicts last-respawns one-shot?)
+                             conflicts last-respawns one-shot? transient?)
        (format #t (l10n "Status of ~a:~%") (first provides))
        (cond (running
-              (format #t (l10n "  It is started.~%"))
+              (if transient?
+                  (format #t (l10n "  It is started and transient.~%"))
+                  (format #t (l10n "  It is started.~%")))
 
               ;; TRANSLATORS: The "~s" bit is most of the time a placeholder
               ;; for the PID (an integer) of the running process, and
diff --git a/tests/transient.sh b/tests/transient.sh
index bf04278..028fa79 100644
--- a/tests/transient.sh
+++ b/tests/transient.sh
@@ -53,12 +53,12 @@ $herd start transient-test1
 $herd start transient-test2
 
 # Stop the service and make sure it gets unregistered.
-$herd status transient-test1 | grep started
+$herd status transient-test1 | grep "started and transient"
 $herd stop transient-test1
 ! $herd status transient-test1
 
 # Terminate the service and make sure it gets unregistered.
-$herd status transient-test2 | grep started
+$herd status transient-test2 | grep "started and transient"
 kill $($herd status transient-test2 | grep Running | sed -e's/^.* 
\([0-9]\+\).*$/\1/g')
 ! $herd status transient-test2
 



reply via email to

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