Subject: [bug#77501] [PATCH] services: opensmtpd: Add logging to a file.

From: Andreas Enge <[email-masked]>
Date: Tue, 8 Apr 2025 11:14:23 +0200

From: Felix Lechner <[email-masked]>

* gnu/services/mail.scm (opensmtpd-shepherd-service)[start]:
Add a command line flag to not daemonize. Drop #:pid-file.
Add #:log-file.

Change-Id: I485e040d680ccb39fa62e49d2e6ea916f047972c
Signed-off-by: Andreas Enge <[email-masked]>
---
Hello,

so just to be sure before I push, the patch below works for you?

Andreas

 gnu/services/mail.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm
index b9a61163d5..0d5af95986 100644
--- a/gnu/services/mail.scm
+++ b/gnu/services/mail.scm
@@ -1742,8 +1742,10 @@ (define (opensmtpd-shepherd-service config)
            (documentation "Run the OpenSMTPD daemon.")
            (start (let ((smtpd (file-append package "/sbin/smtpd")))
                     #~(make-forkexec-constructor
-                       (list #$smtpd "-f" #$config-file)
-                       #:pid-file "/var/run/smtpd.pid")))
+                       (list #$smtpd
+                             "-d"
+                             "-f" #$config-file)
+                       #:log-file "/var/log/maillog")))
            (stop #~(make-kill-destructor))))))
 
 (define %opensmtpd-accounts

base-commit: 43d30332bf3b4de0003578a7b5b27472b11183c7
-- 
2.49.0