@@ -5,6 +5,7 @@
;;; Copyright © 2017, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Kristofer Buffington <kristoferbuffington@gmail.com>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1575,14 +1576,28 @@ (define (dovecot-shepherd-service config)
(let ((dovecot (if (opaque-dovecot-configuration? config)
(opaque-dovecot-configuration-dovecot config)
(dovecot-configuration-dovecot config))))
- (list (shepherd-service
- (documentation "Run the Dovecot POP3/IMAP mail server.")
- (provision '(dovecot))
- (requirement '(pam networking))
- (start #~(make-forkexec-constructor
- (list #$(file-append dovecot "/sbin/dovecot")
- "-F")))
- (stop #~(make-kill-destructor))))))
+ (list
+ (shepherd-service
+ (documentation "Run the Dovecot POP3/IMAP mail server.")
+ (provision '(dovecot))
+ (requirement '(pam networking))
+ (start #~(make-forkexec-constructor
+ (list #$(file-append dovecot "/sbin/dovecot")
+ "-F")))
+ (stop #~(make-kill-destructor))
+ (actions
+ (list (shepherd-action
+ (name 'reopen)
+ (documentation "Re-open log files.")
+ (procedure
+ #~(lambda (pid)
+ (if pid
+ (begin
+ (kill pid SIGUSR1)
+ (format #t
+ "Issued SIGUSR1 to Service Dovecot (PID ~a)."
+ pid))
+ (format #t "Service Dovecot is not running.")))))))))))
(define %dovecot-pam-services
(list (unix-pam-service "dovecot")))