guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 03/06: herd: Print "disabled" in red when the service was res


From: Ludovic Courtès
Subject: [shepherd] 03/06: herd: Print "disabled" in red when the service was respawned.
Date: Wed, 14 Jun 2023 12:46:25 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit a4fe28a39a3bfbcb3a262e83885160d7b0202b38
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Jun 14 17:46:46 2023 +0200

    herd: Print "disabled" in red when the service was respawned.
    
    * modules/shepherd/scripts/herd.scm (display-service-status): Highlight
    differently "It is disabled." depending on whether the service was
    respawned.
---
 modules/shepherd/scripts/herd.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/shepherd/scripts/herd.scm 
b/modules/shepherd/scripts/herd.scm
index 04d8be7..929581f 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -236,7 +236,10 @@ into a @code{live-service} record."
 
   (if (live-service-enabled? service)
       (format #t (l10n "  It is enabled.~%"))
-      (format #t (highlight/warn (l10n "  It is disabled.~%"))))
+      (let ((highlight (if (null? (live-service-last-respawns service))
+                           highlight/warn
+                           highlight/error)))
+        (format #t (highlight (l10n "  It is disabled.~%")))))
   (format #t (l10n "  Provides ~a.~%") (live-service-provision service))
   (format #t (l10n "  Requires ~a.~%") (live-service-requirement service))
   (if (live-service-respawn? service)



reply via email to

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