guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 03/08: service: Soften message when 'stop' returns a truth va


From: Ludovic Courtès
Subject: [shepherd] 03/08: service: Soften message when 'stop' returns a truth value.
Date: Sat, 18 Mar 2023 18:36:36 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 53c6e740e82c856a0450d64a425ca6b8995dc11a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Mar 17 10:07:37 2023 +0100

    service: Soften message when 'stop' returns a truth value.
    
    * modules/shepherd/service.scm (service-controller): Soften message when
    STOPPED? is false.
---
 modules/shepherd/service.scm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index 3595955..91343ad 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -405,11 +405,16 @@ Log abnormal termination reported by @var{status}."
                 (spawn-fiber
                  (lambda ()
                    (let ((stopped? (get-message notification)))
+                     ;; The STOPPED? boolean is supposed to indicate success
+                     ;; or failure, but sometimes 'stop' method might return a
+                     ;; truth value even though the service was successfully
+                     ;; stopped, hence "might have failed" below.
                      (if stopped?
                          (local-output (l10n "Service ~a stopped.")
                                        (canonical-name service))
-                         (local-output (l10n "Failed to stop ~a.")
-                                       (canonical-name service)))
+                         (local-output
+                          (l10n "Service ~a might have failed to stop.")
+                          (canonical-name service)))
                      (put-message channel *service-stopped*))))
                 (local-output (l10n "Stopping service ~a...")
                               (canonical-name service))



reply via email to

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