guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 01/06: herd: 'log' command errors out when there are no event


From: Ludovic Courtès
Subject: [shepherd] 01/06: herd: 'log' command errors out when there are no events.
Date: Wed, 26 Apr 2023 18:10:18 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 81dba8cd51e815c389ca69eba2822cf22a436765
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Apr 24 23:18:00 2023 +0200

    herd: 'log' command errors out when there are no events.
    
    * modules/shepherd/scripts/herd.scm (display-event-log): Error out when
    SORTED is empty.
---
 modules/shepherd/scripts/herd.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/shepherd/scripts/herd.scm 
b/modules/shepherd/scripts/herd.scm
index 5a1e666..654cafe 100644
--- a/modules/shepherd/scripts/herd.scm
+++ b/modules/shepherd/scripts/herd.scm
@@ -271,6 +271,11 @@ into a @code{live-service} record."
             '()
             events))
 
+  (when (null? sorted)
+    ;; The Shepherd 0.9.x and earlier did not log service status changes.
+    (report-error (l10n "event log is missing (shepherd is too old?)"))
+    (exit 1))
+
   (for-each (match-lambda
               ((time service status)
                (let ((name (live-service-canonical-name service)))



reply via email to

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