guix-commits
[Top][All Lists]
Advanced

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

01/03: services: fail2ban: 'stop' returns #f when the dameon is stopped.


From: guix-commits
Subject: 01/03: services: fail2ban: 'stop' returns #f when the dameon is stopped.
Date: Tue, 6 Dec 2022 11:50:53 -0500 (EST)

civodul pushed a commit to branch version-1.4.0
in repository guix.

commit e45c83c3979c2554119fafdee7bb204d27e138b5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Dec 6 17:05:34 2022 +0100

    services: fail2ban: 'stop' returns #f when the dameon is stopped.
    
    * gnu/services/security.scm (fail2ban-shepherd-service): Change
    FAIL2BAN-ACTION to return an 'invoke' gexp.
    Adjust the shepherd 'start' and 'stop' fields accordingly.  Have 'stop'
    return #f on success.
---
 gnu/services/security.scm | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/gnu/services/security.scm b/gnu/services/security.scm
index 15fae7a628..2d048ab47b 100644
--- a/gnu/services/security.scm
+++ b/gnu/services/security.scm
@@ -356,13 +356,12 @@ provided as a list of file-like objects."))
            (config-dir (file-append (config->fail2ban-etc-directory config)
                                     "/etc/fail2ban"))
            (fail2ban-action (lambda args
-                              #~(lambda _
-                                  (invoke #$fail2ban-server
-                                          "-c" #$config-dir
-                                          "-p" #$pid-file
-                                          "-s" #$socket-file
-                                          "-b"
-                                          #$@args)))))
+                              #~(invoke #$fail2ban-server
+                                        "-c" #$config-dir
+                                        "-p" #$pid-file
+                                        "-s" #$socket-file
+                                        "-b"
+                                        #$@args))))
 
       ;; TODO: Add 'reload' action.
       (list (shepherd-service
@@ -371,8 +370,11 @@ provided as a list of file-like objects."))
              (requirement '(user-processes))
              (modules `((ice-9 match)
                         ,@%default-modules))
-             (start (fail2ban-action "start"))
-             (stop (fail2ban-action "stop")))))))
+             (start #~(lambda ()
+                        #$(fail2ban-action "start")))
+             (stop #~(lambda (_)
+                       #$(fail2ban-action "stop")
+                       #f)))))))                  ;successfully stopped
 
 (define fail2ban-service-type
   (service-type (name 'fail2ban)



reply via email to

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