GNU bug report logs - #75550
smartd fails to send an email

Previous Next

Package: guix-patches;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Tue, 14 Jan 2025 01:37:01 UTC

Severity: normal

Done: Hilton Chain <hako <at> ultrarare.space>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Hilton Chain <hako <at> ultrarare.space>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#75550: closed (smartd fails to send an email)
Date: Thu, 30 Jan 2025 12:31:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 30 Jan 2025 20:29:15 +0800
with message-id <87jzaccwo4.wl-hako <at> ultrarare.space>
and subject line Re: [bug#75550] [PATCH v2] gnu: smartmontools: Fix PATH in smartd_warning.sh.
has caused the debbugs.gnu.org bug report #75550,
regarding smartd fails to send an email
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
75550: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75550
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tomas Volf <~@wolfsden.cz>
To: bug-guix <at> gnu.org
Subject: smartd fails to send an email
Date: Tue, 14 Jan 2025 02:36:21 +0100
Hi,

I have tried to write a service type for smartd from smartmontools,
however the bundled script fails.

When the test (-m root -M test) is executed, some programs seem to be
missing in the $PATH:

--8<---------------cut here---------------start------------->8---
Jan 14 01:34:19 localhost smartd[3138]: Executing test of <mail> to root ... 
Jan 14 01:34:19 localhost smartd[3138]: Test of <mail> to root produced unexpected output (118 bytes) to STDOUT/STDERR:  
Jan 14 01:34:19 localhost smartd[3138]: /gnu/store/ks6lnp8hssm9zkka47ysa4qp9xd9f8bv-smartmontools-7.4/etc/smartd_warning.sh: line 132: sed: command not found 
Jan 14 01:34:19 localhost smartd[3138]: Test of <mail> to root: failed (32-bit/8-bit exit status: 32512/127) 
--8<---------------cut here---------------end--------------->8---

At the start of the script I see:

--8<---------------cut here---------------start------------->8---
export PATH="/usr/local/bin:/usr/bin:/bin"
--8<---------------cut here---------------end--------------->8---

That does not look correct.  I am not sure if any wrapping is necessary.

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.


[Message part 3 (message/rfc822, inline)]
From: Hilton Chain <hako <at> ultrarare.space>
To: Tomas Volf <~@wolfsden.cz>
Cc: 75550-done <at> debbugs.gnu.org, Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: Re: [bug#75550] [PATCH v2] gnu: smartmontools: Fix PATH in
 smartd_warning.sh.
Date: Thu, 30 Jan 2025 20:29:15 +0800
On Wed, 29 Jan 2025 07:00:15 +0800,
Tomas Volf wrote:
>
> The script started with reset of the $PATH to a value not suitable to Guix.
> In addition, the script requires coreutils and sed, so add those into the
> $PATH.
>
> * gnu/packages/admin.scm (smartmontools)[inputs]: Add sed, coreutils-minimal.
> [arguments]<#:configure-flags>: Pass --with-scriptpath=.
>
> Change-Id: Ide97f572e6f369fe24337f945474dc7a65584eda
> ---
>  gnu/packages/admin.scm | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index fd5d67ec50..e21f3f6e19 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -3051,9 +3051,16 @@ (define-public smartmontools
>                  "0gcrzcb4g7f994n6nws26g6x15yjija1gyzd359sjv7r3xj1z9p9"))))
>      (build-system gnu-build-system)
>      (arguments
> -     (list #:make-flags
> -           #~(list "BUILD_INFO=\"(Guix)\"")))
> -    (inputs (list libcap-ng))
> +     (list
> +      #:make-flags
> +      #~(list "BUILD_INFO=\"(Guix)\"")
> +      #:configure-flags
> +      #~(list (format #f "--with-scriptpath=~a:~a:$PATH"
> +                      (dirname (search-input-file %build-inputs "bin/sed"))
> +                      (dirname (search-input-file %build-inputs "bin/true"))))))

I have modified #:configure-flags to use `this-package-input', to have proper
cross build support:
--8<---------------cut here---------------start------------->8---
#~(list (format #f "--with-scriptpath=~{~a:~}$PATH"
                (map (lambda (pkg)
                       (in-vicinity pkg "bin"))
                     '#$(list (this-package-input "coreutils-minimal")
                              (this-package-input "sed")))))
--8<---------------cut here---------------end--------------->8---

Thinking of the limitation of %build-inputs, it might be convenient to define
`inputs' and `native-inputs' directly in builder's environment.  🤔

Anyway, applied as f7fc4caf7da8f1d7cc76b3bc6ac0c4e643507454 with above change.

> +    (inputs (list coreutils-minimal
> +                  libcap-ng
> +                  sed))
>      (home-page "https://www.smartmontools.org/")
>      (synopsis "S.M.A.R.T. harddisk control and monitoring tools")
>      (description
> --
> 2.47.1

Thanks


This bug report was last modified 114 days ago.

Previous Next


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