Acknowledgement sent
to Felix Lechner <felix.lechner@lease-up.com>:
New bug report received and forwarded. Copy sent to guix-patches@gnu.org.
(Thu, 03 Apr 2025 18:07:01 GMT) (full text, mbox, link).
Cc: Gabriel Wicki <gabriel@erlikon.ch>, 77501@debbugs.gnu.org
Subject: Re: OpenSMTP logging
Date: Thu, 3 Apr 2025 20:55:45 +0200
Hello,
Am Thu, Apr 03, 2025 at 11:13:50AM -0700 schrieb Felix Lechner via:
> P.S. I linked to my Debbugs clone since Mumi did not pick it up.
this was probably just a question of time; I can see it now on issues.
> I can confirm that logging in OpenSMTPd is broken. I fixed it locally
> with the patch in Bug#77501. [1]
This looks good to me as someone who knows very little about services...
I have looked at the shepherd manual, and in
https://www.gnu.org/software/shepherd/manual/shepherd.html#Service-De_002d-and-Constructors
it says the following about make-fork-exec-constructor:
"Note: This will not work as expected if the process “daemonizes”
(forks); in that case, you will need to pass #:pid-file, as explained
below."
Now that you do not daemonize, is #:pid-file still needed or useful?
#:log-file "/var/log/maillog"
And is this the good file name? Not mail.log?
Andreas
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Thu, 03 Apr 2025 19:40:02 GMT) (full text, mbox, link).
Cc: Gabriel Wicki <gabriel@erlikon.ch>, 77501@debbugs.gnu.org
Subject: Re: OpenSMTP logging
Date: Thu, 03 Apr 2025 12:39:46 -0700
Hi Andreas,
On Thu, Apr 03 2025, Andreas Enge wrote:
> This looks good to me
Thanks for taking a look!
> is #:pid-file still needed or useful?
No, it isn't. It also occurred to me after I had sent in the patch, and
moved onto something else.
As a side note, I'm not sure we have the luxury of making such minor
improvements. Guix is already a system with a thousand warts. My patch
definitely makes Guix better.
Either way, I'd be happy to remove it if we can reach an acceptance deal
per below.
> And is this the good file name?
It isn't, but I think /var/log/maillog has a long tradition with
Sendmail.
The filename should actually be configurable, but I won't submit such a
patch unless you promise to accept it. I already have a gazillion
rebases because my patches, which I carry in my custom branch, are
almost never accepted.
Kind regards
Felix
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Tue, 08 Apr 2025 09:16:02 GMT) (full text, mbox, link).
Subject: Re: [bug#77501] [PATCH] services: opensmtpd: Add logging to a file.
Date: Tue, 08 Apr 2025 20:30:26 +0200
Andreas Enge <andreas@enge.fr> writes:
> 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")))
Probably out of scope but would be cool to have this configurable, I
personally prefer /var/log/mail.log. I assume you have enough on your
hands already, so will send a separate patch later.
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Tue, 08 Apr 2025 18:42:02 GMT) (full text, mbox, link).
Subject: Re: [bug#77501] [PATCH] services: opensmtpd: Add logging to a file.
Date: Tue, 8 Apr 2025 20:41:24 +0200
Am Tue, Apr 08, 2025 at 08:30:26PM +0200 schrieb Tomas Volf:
> Probably out of scope but would be cool to have this configurable, I
> personally prefer /var/log/mail.log. I assume you have enough on your
> hands already, so will send a separate patch later.
Sounds good, thanks! You can already start the bikeshedding discussion
about what the default value should be :)
Andreas
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Tue, 08 Apr 2025 18:53:01 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>, Gabriel Wicki <gabriel@erlikon.ch>,
Andreas Enge <andreas@enge.fr>
Subject: Re: [bug#77501] [PATCH] services: opensmtpd: Add logging to a file.
Date: Tue, 08 Apr 2025 11:52:34 -0700
Hi Andreas & Tomas,
On Tue, Apr 08 2025, Andreas Enge wrote:
> You can already start the bikeshedding
No bikeshedding needed! Given the emerging consensus, which includes a
senior committer, I will happily prepare a patch that makes the name of
the log file configurable.
Like both of you, I also find mail.log more agreeable.
Anyway, it's easy to change that default later, but it would be harder
to change the name of the option, which is part of the API.
Is "log-file" okay?
Kind regards
Felix
Information forwarded
to ludo@gnu.org, maxim.cournoyer@gmail.com, guix-patches@gnu.org: bug#77501; Package guix-patches.
(Tue, 08 Apr 2025 21:36:01 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>, Gabriel Wicki <gabriel@erlikon.ch>,
Maxim Cournoyer <maxim.cournoyer@gmail.com>, 77501@debbugs.gnu.org,
Andreas Enge <andreas@enge.fr>
Subject: Re: [bug#77501] [PATCH] Log OpenSMTPd to /var/log/mail.log via a
configurable option. (Closes: #77501)
Date: Wed, 09 Apr 2025 23:22:58 +0200
Hi,
Felix Lechner <felix.lechner@lease-up.com> skribis:
> Please also see this thread:
>
> https://lists.gnu.org/archive/html/help-guix/2025-04/msg00009.html
>
> Change-Id: I485e040d680ccb39fa62e49d2e6ea916f047972c
Could you add a conventional commit log?
[...]
> #~(make-forkexec-constructor
> - (list #$smtpd "-f" #$config-file)
> - #:pid-file "/var/run/smtpd.pid")))
> + (list #$smtpd
> + "-d"
> + "-f" #$config-file)
> + #:log-file #$log-file)))
I believe #:pid-file should be kept, no?
I would also keep the (list …) bit on a single line.
Thanks,
Ludo’.
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Wed, 09 Apr 2025 21:59:01 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>, Gabriel Wicki <gabriel@erlikon.ch>,
Maxim Cournoyer <maxim.cournoyer@gmail.com>, 77501@debbugs.gnu.org,
Felix Lechner <felix.lechner@lease-up.com>
Subject: Re: [bug#77501] [PATCH] Log OpenSMTPd to /var/log/mail.log via a
configurable option. (Closes: #77501)
Date: Wed, 9 Apr 2025 23:58:22 +0200
Am Wed, Apr 09, 2025 at 11:22:58PM +0200 schrieb Ludovic Courtès:
> Could you add a conventional commit log?
This was there in my version of the patch a bit further up.
> > #~(make-forkexec-constructor
> > - (list #$smtpd "-f" #$config-file)
> > - #:pid-file "/var/run/smtpd.pid")))
> > + (list #$smtpd
> > + "-d"
> > + "-f" #$config-file)
> > + #:log-file #$log-file)))
> I believe #:pid-file should be kept, no?
This was dropped following my remark above:
"I have looked at the shepherd manual, and in
https://www.gnu.org/software/shepherd/manual/shepherd.html#Service-De_002d-and-Constructors
it says the following about make-fork-exec-constructor:
'Note: This will not work as expected if the process “daemonizes”
(forks); in that case, you will need to pass #:pid-file, as explained
below.'
Now that you do not daemonize, is #:pid-file still needed or useful?"
The "-d" flag passed to #$smtpd prevents it from "daemonizing". So we
concluded that the #:pid-file thing was not needed (maybe it is needed,
but then the documentation should be adapted).
Andreas
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Thu, 10 Apr 2025 12:36:02 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>, Gabriel Wicki <gabriel@erlikon.ch>,
Maxim Cournoyer <maxim.cournoyer@gmail.com>, 77501@debbugs.gnu.org,
Felix Lechner <felix.lechner@lease-up.com>
Subject: Re: [bug#77501] [PATCH] Log OpenSMTPd to /var/log/mail.log via a
configurable option. (Closes: #77501)
Date: Thu, 10 Apr 2025 12:24:24 +0200
Andreas Enge <andreas@enge.fr> skribis:
> The "-d" flag passed to #$smtpd prevents it from "daemonizing". So we
> concluded that the #:pid-file thing was not needed (maybe it is needed,
> but then the documentation should be adapted).
Oh I see, understood.
Thanks for explaining!
Ludo'.
Reply sent
to Andreas Enge <andreas@enge.fr>:
You have taken responsibility.
(Thu, 10 Apr 2025 13:43:01 GMT) (full text, mbox, link).
Notification sent
to Felix Lechner <felix.lechner@lease-up.com>:
bug acknowledged by developer.
(Thu, 10 Apr 2025 13:43:02 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>, Gabriel Wicki <gabriel@erlikon.ch>,
Maxim Cournoyer <maxim.cournoyer@gmail.com>,
Felix Lechner <felix.lechner@lease-up.com>, 77501-done@debbugs.gnu.org
Subject: Re: [bug#77501] [PATCH] Log OpenSMTPd to /var/log/mail.log via a
configurable option. (Closes: #77501)
Date: Thu, 10 Apr 2025 15:41:52 +0200
I have added a commit message and a copyright header, turned the list
into one line and pushed.
Thanks to all!
Andreas
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Mon, 14 Apr 2025 00:54:01 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>, Andreas Enge <andreas@enge.fr>,
Gabriel Wicki <gabriel@erlikon.ch>, 77501@debbugs.gnu.org,
Felix Lechner <felix.lechner@lease-up.com>
Subject: Re: [bug#77501] [PATCH] Log OpenSMTPd to /var/log/mail.log via a
configurable option. (Closes: #77501)
Date: Mon, 14 Apr 2025 09:52:53 +0900
Hi Andreas,
Ludovic Courtès <ludo@gnu.org> writes:
> Andreas Enge <andreas@enge.fr> skribis:
>
>> The "-d" flag passed to #$smtpd prevents it from "daemonizing". So we
>> concluded that the #:pid-file thing was not needed (maybe it is needed,
>> but then the documentation should be adapted).
From my understanding, a pid file is still useful for *synchronization*
reasons, whether the service daemonizes or not. It's a token that lets
the service notify the init system that "OK, I've done my basic startup,
I'm ready to receive client requests".
That's been progressively replaced by socket activation in the systemd
world (and we support that via make-systemd-constructor, though I've
found some issue with it when using TLS connections -- to be reported
separately).
--
Thanks,
Maxim
Information forwarded
to guix-patches@gnu.org: bug#77501; Package guix-patches.
(Mon, 14 Apr 2025 07:59:01 GMT) (full text, mbox, link).
Cc: Tomas Volf <~@wolfsden.cz>,
Ludovic Courtès <ludo@gnu.org>,
Gabriel Wicki <gabriel@erlikon.ch>, 77501@debbugs.gnu.org,
Felix Lechner <felix.lechner@lease-up.com>
Subject: Re: [bug#77501] [PATCH] Log OpenSMTPd to /var/log/mail.log via a
configurable option. (Closes: #77501)
Date: Mon, 14 Apr 2025 09:58:26 +0200
Hello Maxim,
Am Mon, Apr 14, 2025 at 09:52:53AM +0900 schrieb Maxim Cournoyer:
> From my understanding, a pid file is still useful for *synchronization*
> reasons, whether the service daemonizes or not. It's a token that lets
> the service notify the init system that "OK, I've done my basic startup,
> I'm ready to receive client requests".
would you like to update the documentation and re-add the pid file
for this service here?
Andreas
Debbugs is free software and licensed under the terms of the
GNU Public License version 2. The current version can be
obtained from https://bugs.debian.org/debbugs-source/.