[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 04/06: herd: ‘herd status’ lists timers separately.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 04/06: herd: ‘herd status’ lists timers separately. |
Date: |
Sun, 24 Mar 2024 17:11:35 -0400 (EDT) |
civodul pushed a commit to branch devel
in repository shepherd.
commit 3b098074cd6efe10e3aa6bc08d9d1161cd501181
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sun Mar 24 15:53:32 2024 +0100
herd: ‘herd status’ lists timers separately.
* modules/shepherd/scripts/herd.scm (live-service-timer?): New
procedure.
(display-status-summary): Display timers separately from other started
services.
---
modules/shepherd/scripts/herd.scm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/shepherd/scripts/herd.scm
b/modules/shepherd/scripts/herd.scm
index 78917af..7c13568 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -69,6 +69,12 @@
"Return the 'canonical name' of @var{service}."
(first (live-service-provision service)))
+(define (live-service-timer? service)
+ "Return true if @var{service}'s value is a timer."
+ (match (live-service-running-value service)
+ (('timer . _) #t)
+ (_ #f)))
+
(define (live-service-failing? service)
"Return true if @var{service} failed to start."
(and (eq? 'stopped (live-service-status service))
@@ -158,10 +164,13 @@ transient status for too long."
(stopped (filter (live-service-status-predicate 'stopped) services))
(starting (filter (live-service-status-predicate 'starting) services))
(stopping (filter (live-service-status-predicate 'stopping) services))
+ (timers started (partition live-service-timer? started))
(one-shot stopped (partition live-service-one-shot? stopped))
(failing stopped (partition live-service-failing? stopped)))
(display-services (highlight (l10n "Started:\n")) "+"
started)
+ (display-services (highlight (l10n "Running timers:\n")) "+"
+ timers)
(display-services (highlight (l10n "Starting:\n")) "^"
starting)
- [shepherd] branch devel updated (33bcc05 -> 13bb402), Ludovic Courtès, 2024/03/24
- [shepherd] 03/06: herd: Display upcoming timer alarms., Ludovic Courtès, 2024/03/24
- [shepherd] 04/06: herd: ‘herd status’ lists timers separately.,
Ludovic Courtès <=
- [shepherd] 01/06: Add timer services., Ludovic Courtès, 2024/03/24
- [shepherd] 02/06: herd: Display information about timers., Ludovic Courtès, 2024/03/24
- [shepherd] 05/06: service: Re-purpose ‘action’ to create a new action., Ludovic Courtès, 2024/03/24
- [shepherd] 06/06: timer: Add optional ‘trigger’ action., Ludovic Courtès, 2024/03/24