GNU bug report logs - #45153
[PATCH] gnu: rottlog: Fix mail reporting.

Previous Next

Package: guix-patches;

Reported by: dftxbs3e <dftxbs3e <at> free.fr>

Date: Thu, 10 Dec 2020 03:42:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45153 in the body.
You can then email your comments to 45153 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Thu, 10 Dec 2020 03:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to dftxbs3e <dftxbs3e <at> free.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 10 Dec 2020 03:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dftxbs3e <dftxbs3e <at> free.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: rottlog: Fix mail reporting.
Date: Thu, 10 Dec 2020 04:41:29 +0100
[Message part 1 (text/plain, inline)]
Hello!

I was getting errors like this in my GNU Guix System installation:

# cat /var/log/mcron.log
/gnu/store/8q2i735qhdivn5pn87b6ay7z16xnf6py-rottlog-
0.72.2/sbin/rottlog: line 1596: sendmail: command not found
/gnu/store/8q2i735qhdivn5pn87b6ay7z16xnf6py-rottlog-
0.72.2/sbin/rottlog: line 1596: sendmail: command not found
/gnu/store/8q2i735qhdivn5pn87b6ay7z16xnf6py-rottlog-
0.72.2/sbin/rottlog: line 1596: sendmail: command not found
/gnu/store/8q2i735qhdivn5pn87b6ay7z16xnf6py-rottlog-
0.72.2/sbin/rottlog: line 1596: sendmail: command not found
/gnu/store/8q2i735qhdivn5pn87b6ay7z16xnf6py-rottlog-
0.72.2/sbin/rottlog: line 1596: sendmail: command not found

I am guessing this means sendmail needs to be added as propagated-
inputs to ensure it is available to rottlog at runtime.

Attached patch with these changes!

Thank you!
[0001-gnu-rottlog-Fix-mail-reporting.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Fri, 11 Dec 2020 17:58:02 GMT) Full text and rfc822 format available.

Message #8 received at 45153 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: dftxbs3e <dftxbs3e <at> free.fr>
Cc: 45153 <at> debbugs.gnu.org
Subject: Re: [bug#45153] [PATCH] gnu: rottlog: Fix mail reporting.
Date: Fri, 11 Dec 2020 18:57:44 +0100
Hi,

dftxbs3e <dftxbs3e <at> free.fr> skribis:

> From 6aab4645706f9fe285c253142efe4e9fd40f2c3a Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?L=C3=A9o=20Le=20Bouter?= <lle-bout <at> zaclys.net>
> Date: Thu, 10 Dec 2020 04:35:38 +0100
> Subject: [PATCH] gnu: rottlog: Fix mail reporting.
>
> * gnu/packages/admin.scm (rottlog):
> [propagated-inputs]: Add sendmail.
> ---
>  gnu/packages/admin.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 9df14b5ca0..5c22d40d1d 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -1385,6 +1385,7 @@ at once based on a Perl regular expression.")
>                       ("automake" ,automake)
>                       ("util-linux" ,util-linux))) ; for 'cal'
>      (inputs `(("coreutils*" ,coreutils)))
> +    (propagated-inputs `(("sendmail" ,sendmail)))

A better approach would be to avoid the propagated inputs and instead
replace the reference to ‘mail’ (or ‘sendmail’?) in the code by a
reference to its absolute file name (if it’s ‘mail’, I’d suggest picking
the ‘mail’ command from Inetutils.)

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Sat, 12 Dec 2020 08:48:02 GMT) Full text and rfc822 format available.

Message #11 received at 45153 <at> debbugs.gnu.org (full text, mbox):

From: John Doe <dftxbs3e <at> free.fr>
To: 45153 <at> debbugs.gnu.org
Cc: Léo Le Bouter <lle-bout <at> zaclys.net>
Subject: [PATCH v2] gnu: rottlog: Fix mail reporting.
Date: Sat, 12 Dec 2020 09:46:39 +0100
From: Léo Le Bouter <lle-bout <at> zaclys.net>

* gnu/packages/admin.scm (rottlog):
[inputs]: Add sendmail.
[phases]: Modify 'patch-paths to substitute sendmail command with
/gnu/store item.
---
 gnu/packages/admin.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9df14b5ca0..9394545003 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -107,6 +107,7 @@
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages mail)
   #:use-module (gnu packages man)
   #:use-module (gnu packages mcrypt)
   #:use-module (gnu packages mpi)
@@ -1343,9 +1344,11 @@ at once based on a Perl regular expression.")
 
        #:phases (modify-phases %standard-phases
                   (add-after 'unpack 'patch-paths
-                    (lambda _
+                    (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "rc/rc"
-                        (("/usr/sbin/sendmail") "sendmail"))
+                        (("/usr/sbin/sendmail")
+                         (string-append (assoc-ref inputs "sendmail")
+                                        "/usr/sbin/sendmail")))
                       #t))
                   (add-after 'unpack 'fix-configure
                     (lambda* (#:key inputs native-inputs #:allow-other-keys)
@@ -1384,7 +1387,8 @@ at once based on a Perl regular expression.")
     (native-inputs `(("texinfo" ,texinfo)
                      ("automake" ,automake)
                      ("util-linux" ,util-linux))) ; for 'cal'
-    (inputs `(("coreutils*" ,coreutils)))
+    (inputs `(("coreutils*" ,coreutils)
+              ("sendmail" ,sendmail)))
     (home-page "https://www.gnu.org/software/rottlog/")
     (synopsis "Log rotation and management")
     (description
-- 
2.29.2





Information forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Sat, 12 Dec 2020 20:26:02 GMT) Full text and rfc822 format available.

Message #14 received at 45153 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: John Doe <dftxbs3e <at> free.fr>
Cc: Léo Le Bouter <lle-bout <at> zaclys.net>, 45153 <at> debbugs.gnu.org
Subject: Re: [bug#45153] [PATCH v2] gnu: rottlog: Fix mail reporting.
Date: Sat, 12 Dec 2020 22:25:34 +0200
[Message part 1 (text/plain, inline)]
If there's no mail server setup on the Guix System machine where does
the mail go?

On Sat, Dec 12, 2020 at 09:46:39AM +0100, John Doe wrote:
> From: Léo Le Bouter <lle-bout <at> zaclys.net>
> 
> * gnu/packages/admin.scm (rottlog):
> [inputs]: Add sendmail.
> [phases]: Modify 'patch-paths to substitute sendmail command with
> /gnu/store item.
> ---
>  gnu/packages/admin.scm | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 9df14b5ca0..9394545003 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -107,6 +107,7 @@
>    #:use-module (gnu packages libusb)
>    #:use-module (gnu packages linux)
>    #:use-module (gnu packages lua)
> +  #:use-module (gnu packages mail)
>    #:use-module (gnu packages man)
>    #:use-module (gnu packages mcrypt)
>    #:use-module (gnu packages mpi)
> @@ -1343,9 +1344,11 @@ at once based on a Perl regular expression.")
>  
>         #:phases (modify-phases %standard-phases
>                    (add-after 'unpack 'patch-paths
> -                    (lambda _
> +                    (lambda* (#:key inputs #:allow-other-keys)
>                        (substitute* "rc/rc"
> -                        (("/usr/sbin/sendmail") "sendmail"))
> +                        (("/usr/sbin/sendmail")
> +                         (string-append (assoc-ref inputs "sendmail")
> +                                        "/usr/sbin/sendmail")))
>                        #t))
>                    (add-after 'unpack 'fix-configure
>                      (lambda* (#:key inputs native-inputs #:allow-other-keys)
> @@ -1384,7 +1387,8 @@ at once based on a Perl regular expression.")
>      (native-inputs `(("texinfo" ,texinfo)
>                       ("automake" ,automake)
>                       ("util-linux" ,util-linux))) ; for 'cal'
> -    (inputs `(("coreutils*" ,coreutils)))
> +    (inputs `(("coreutils*" ,coreutils)
> +              ("sendmail" ,sendmail)))
>      (home-page "https://www.gnu.org/software/rottlog/")
>      (synopsis "Log rotation and management")
>      (description
> -- 
> 2.29.2
> 
> 
> 
> 

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Sat, 12 Dec 2020 20:50:02 GMT) Full text and rfc822 format available.

Message #17 received at 45153 <at> debbugs.gnu.org (full text, mbox):

From: dftxbs3e <dftxbs3e <at> free.fr>
To: 45153 <at> debbugs.gnu.org
Subject: Re: [bug#45153] [PATCH v2] gnu: rottlog: Fix mail reporting.
Date: Sat, 12 Dec 2020 21:49:15 +0100
On Sat, 2020-12-12 at 22:25 +0200, Efraim Flashner wrote:
> If there's no mail server setup on the Guix System machine where does
> the mail go?

Not sure, I don't know how rottlog works and what parameters it gives
to sendmail. Can emails be sent without a mail server? Like when they
are sent to a UNIX account for example? That's what I would guess it
does, write mail to /var/mail/root or something.

Actually fixing mail reporting might need additional patching, I
focused on fixing the issue I met and had logs of.





Information forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Wed, 23 Dec 2020 15:04:02 GMT) Full text and rfc822 format available.

Message #20 received at 45153 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: John Doe <dftxbs3e <at> free.fr>
Cc: Léo Le Bouter <lle-bout <at> zaclys.net>, 45153 <at> debbugs.gnu.org
Subject: Re: [bug#45153] [PATCH v2] gnu: rottlog: Fix mail reporting.
Date: Wed, 23 Dec 2020 16:02:51 +0100
[Message part 1 (text/plain, inline)]
Hi!

John Doe <dftxbs3e <at> free.fr> skribis:

> From: Léo Le Bouter <lle-bout <at> zaclys.net>
>
> * gnu/packages/admin.scm (rottlog):
> [inputs]: Add sendmail.
> [phases]: Modify 'patch-paths to substitute sendmail command with
> /gnu/store item.

[...]

> +                        (("/usr/sbin/sendmail")
> +                         (string-append (assoc-ref inputs "sendmail")
> +                                        "/usr/sbin/sendmail")))

I thought this was a typo and then realized that our ‘sendmail’ package
is this broken, due to an incorrect use of ‘DESTDIR’.

The patch below is an attempt to fix that but some of the files are
silently not getting installed.  Anyone has ideas here?

Anyhow, can we instead use ‘mail’ from ‘mailutils’ instead?  (I
wrongfully mentioned Inetutils earlier, sorry for the confusion.)

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index f85713433e..1f06450e6a 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2759,23 +2759,39 @@ powerful user customization features.")
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
          (replace 'configure
-           (lambda _
+           (lambda* (#:key outputs #:allow-other-keys)
 
              ;; Render harmless any attempts to chown or chgrp
              (substitute* "devtools/bin/install.sh"
                (("owner=\\$2") "owner=''")
                (("group=\\$2") "group=''"))
 
-             (with-output-to-file "devtools/Site/site.config.m4"
-               (lambda ()
-                 (format #t "
+             (let ((out (assoc-ref outputs "out")))
+               (with-output-to-file "devtools/Site/site.config.m4"
+                 (lambda ()
+                   ;; See 'devtools/M4/UNIX/defines.m4' for the list of
+                   ;; installation directories.
+                   (format #t "
 define(`confCC', `gcc')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
 define(`confINSTALL', `~a/devtools/bin/install.sh')
 define(`confDEPEND_TYPE', `CC-M')
 define(`confINST_DEP', `')
-" (getcwd))))
+
+define(`confMBINDIR', `~a/bin')
+define(`confUBINDIR', `~a/bin')
+define(`confSBINDIR', `~a/sbin')
+define(`confEBINDIR', `~a/libexec')
+define(`confMANROOT', `~a/share/man')~%"
+                           (getcwd)
+                           out out out out out))))
+
+             (substitute* "cf/cf/Makefile"
+               (("^MAILDIR=.*")
+                (string-append "MAILDIR = "
+                               (assoc-ref outputs "out")
+                               "/etc/mail\n")))
              #t))
          (replace 'build
            (lambda _
@@ -2787,10 +2803,9 @@ define(`confINST_DEP', `')
          (add-before 'install 'pre-install
            (lambda _
              (let ((out (assoc-ref %outputs "out")))
-               (mkdir-p (string-append out "/usr/bin"))
-               (mkdir-p (string-append out "/usr/sbin"))
+               (mkdir-p (string-append out "/bin"))
+               (mkdir-p (string-append out "/sbin"))
                (mkdir-p (string-append out "/etc/mail"))
-               (setenv "DESTDIR" out)
                (with-directory-excursion "cf/cf"
                  (invoke "sh" "Build" "install-cf"))
                #t))))

Information forwarded to guix-patches <at> gnu.org:
bug#45153; Package guix-patches. (Wed, 23 Dec 2020 15:20:01 GMT) Full text and rfc822 format available.

Message #23 received at 45153 <at> debbugs.gnu.org (full text, mbox):

From: Leo Le Bouter <lle-bout <at> zaclys.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 45153 <at> debbugs.gnu.org
Subject: Re: [bug#45153] [PATCH v2] gnu: rottlog: Fix mail reporting.
Date: Wed, 23 Dec 2020 16:19:26 +0100
[Message part 1 (text/plain, inline)]
On Wed, 2020-12-23 at 16:02 +0100, Ludovic Courtès wrote:
> Hi!

Hello!

> I thought this was a typo and then realized that our ‘sendmail’
> package
> is this broken, due to an incorrect use of ‘DESTDIR’.

Ah! Well I did not notice that as something wrong outright but now that
you say that yes I see the correct behavior :-)

> The patch below is an attempt to fix that but some of the files are
> silently not getting installed.  Anyone has ideas here?

Will take a look!

> Anyhow, can we instead use ‘mail’ from ‘mailutils’ instead?  (I
> wrongfully mentioned Inetutils earlier, sorry for the confusion.)

Is it going to be compatible? If so then I'll do it!

> Thanks,
> Ludo’.

Thank *you*! :-)
[signature.asc (application/pgp-signature, inline)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 27 Dec 2020 15:08:01 GMT) Full text and rfc822 format available.

Notification sent to dftxbs3e <dftxbs3e <at> free.fr>:
bug acknowledged by developer. (Sun, 27 Dec 2020 15:08:01 GMT) Full text and rfc822 format available.

Message #28 received at 45153-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Leo Le Bouter <lle-bout <at> zaclys.net>
Cc: 45153-done <at> debbugs.gnu.org
Subject: Re: [bug#45153] [PATCH v2] gnu: rottlog: Fix mail reporting.
Date: Sun, 27 Dec 2020 16:07:50 +0100
Hi,

Leo Le Bouter <lle-bout <at> zaclys.net> skribis:

>> I thought this was a typo and then realized that our ‘sendmail’
>> package
>> is this broken, due to an incorrect use of ‘DESTDIR’.
>
> Ah! Well I did not notice that as something wrong outright but now that
> you say that yes I see the correct behavior :-)
>
>> The patch below is an attempt to fix that but some of the files are
>> silently not getting installed.  Anyone has ideas here?
>
> Will take a look!

Great.

>> Anyhow, can we instead use ‘mail’ from ‘mailutils’ instead?  (I
>> wrongfully mentioned Inetutils earlier, sorry for the confusion.)
>
> Is it going to be compatible? If so then I'll do it!

Yes, I think so, again provided there’s a mail setup on the machine.

I went ahead and made this change since it was a minor change compared
to the patch you had sent earlier.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 25 Jan 2021 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.