Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 140192 - sys-apps/smartmontools-5.36 missing mail command
Summary: sys-apps/smartmontools-5.36 missing mail command
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Other
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 282371 282884 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-07-13 00:51 UTC by Jacek Sieka
Modified: 2013-08-09 10:12 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mailx.sh (mailx.sh,3.59 KB, text/plain)
2009-08-31 20:03 UTC, Gilles Dartiguelongue (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacek Sieka 2006-07-13 00:51:52 UTC
Hi,

I have smartmontolls setup so that it will mail me, but on a default gentoo install, the command "mail" is missing, and thus no mail is sent and the following thing is written to the system logs (mail address edited out):

Jul 13 09:45:47 green smartd[28520]: Sending warning via mail to ...
Jul 13 09:45:47 green smartd[28520]: Warning via mail to ... produced unexpected output (28 bytes) to STDOUT/STDERR:  sh: mail: command not found
Jul 13 09:45:47 green smartd[28520]: Warning via mail to ...: failed (32-bit/8-bit exit status: 32512/127)

A dependency on a package which supplies a mail command would be nice (net-mail/mailutils?).

Let me know if there's anything else I can help with.

Thanks!
Comment 1 SpanKY gentoo-dev 2006-07-14 22:03:43 UTC
added virtual/mailx to RDEPEND, thanks for the report
Comment 2 cilly 2006-07-16 20:08:33 UTC
It would have been nice to add a useflag, too, i.e. -mailx. Since some people do not want to install mailx and use other mail services. Also, mailx is not the best choice for a hardwired useflag, it is bsd licence.
Comment 3 Ian Stakenvicius 2006-07-17 06:25:12 UTC
I'll second the use-flag request.  If you're not using the mail directive in the config file there's no need for this package.
Comment 4 Jacek Sieka 2006-07-17 06:38:51 UTC
+1 for use flag, I'd be annoyed if I didn't need it =)
Comment 5 Grzegorz Kulewski 2006-08-15 10:20:29 UTC
I agree with previous comments. Reporting SMART problems via email is completly _optional_ feature that needs to be additionally configured and is used in rare cases.

With current ebuild smartmontools, a very basic and needed package, unconditionally wants to install several mail packages. I really don't want them in my minimal system (that will never be able to send any mails - minimal host system for openvz).

Also I think one can be able to configure smartmontools to run as a demon, report problems to system log and send mail via some logwatcher on another host.

"Mighty devs", please reopen this bug and add USE flag ASAP. Thanks!
Comment 6 Stefan Schweizer (RETIRED) gentoo-dev 2006-08-15 13:20:39 UTC
a mail use flag sounds good to me. Otherwise remove this unneeded depend please and require users to figure it out themselves with the log (yes I think that can be expected from a gentoo user)
Comment 7 Stefan Schweizer (RETIRED) gentoo-dev 2006-09-01 08:43:12 UTC
I mailed base-system@ about this and pinged them in IRC - I hope they reply.
This is what should be done:

-RDEPEND="virtual/mailx"
+RDEPEND=""

+
+pkg_postinst() {
+       elog "You need the 'mail' command if you configured smartd to
send reports"
+       elog "via email, 'emerge virtual/mailx' to get a mailer"
+}
Comment 8 Jacek Sieka 2006-09-01 10:39:42 UTC
I disagree with the solution (but then again, I'm only a (l)user =) - a use flag would IMHO be easier for the user...I tend to miss to-screen logs often, specially when updating many packages at once, and use flags are used very often to control dependencies, so why not here?
Comment 9 Stefan Schweizer (RETIRED) gentoo-dev 2006-09-01 10:44:06 UTC
because the use flag changes nothing at runtime and creates unneeded configuration effort

you can use the PORTAGE_ELOG_SYSTEM to see elog messages that are important - see /etc/make.conf.example for documentation
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2006-09-02 01:20:10 UTC
+1 - please remove this.
Comment 11 Stefan Schweizer (RETIRED) gentoo-dev 2006-09-03 07:49:33 UTC
fixed properly. Thank you all and especially chainsaw.
Comment 12 Navid Zamani 2008-10-01 18:13:40 UTC
Uum, sorry. I installed smartmontools-5.36 and enabled mailing for smartd, the mail test was missing the mail command, so I searched, and found this bug here. I tried 5.37, but there was no use flag to enable the dependency on virtual/mailx.

I do not want to remember a manual dependency in the age of portage, by manually adding and removing packages when I remove the packages that depended on them. After years, nobody is going to remember that mailx was installed for smartmontools, and when I uninstall it, mailx will be left because it's in the world file. This is exactly one kind problem, that portage was made to solve.

So from this POV, the problem is neither resolved nor fixed.

Can anyone explain, why I was marked as fixed? The comments don't seem to clarify this.
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-26 22:59:52 UTC
*** Bug 282371 has been marked as a duplicate of this bug. ***
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-26 23:02:19 UTC
In light of bug 282371 and more modern times, I'm going to re-add the dep, behind USE=!minimal, which already controls the daemon.
Comment 15 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-26 23:08:19 UTC
Committed now.
Comment 16 Navid Zamani 2009-08-26 23:08:50 UTC
Does anyone care to answer comment #12?
Comment 17 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-27 00:27:48 UTC
(In reply to comment #16)
> Does anyone care to answer comment #12?
Please READ my commit, and you'll see I did that already.
+RDEPEND="!minimal? ( virtual/mailx )"
Comment 18 Navid Zamani 2009-08-27 00:54:34 UTC
(In reply to comment #17)
Ah, allright. Thank you. :)
I should learn to write ebuilds. Then I could contribute this myself. ^^
Comment 19 SpanKY gentoo-dev 2009-08-27 10:44:04 UTC
*** Bug 282884 has been marked as a duplicate of this bug. ***
Comment 20 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-08-27 13:44:29 UTC
reopening bug per duplicated bug. Please find there comments against changes done in 5.38-r1.
Comment 21 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-27 19:02:58 UTC
(In reply to comment #0 on bug 282884)
> Note that by default under Solaris, in the previous paragraph, 'mailx' and
> '/bin/mailx' are used, since Solaris '/bin/mail' does not accept a '-s'
> (Subject) command-line argument."
> 
> and also:
> 
> "smartd will attempt to enable SMART monitoring [...], logging SMART errors and
> changes of SMART Attributes via the SYSLOG interface."
> 
> So what I'm asking is a removal of mailx as a dependency of smartmontools
> since:
The dep is explicitly stated as:
RDEPEND="!minimal? ( virtual/mailx )"

The virtual is provided by:
mail-client/nail
mail-client/mailx
net-mail/mailutils
(exim used to provide it as well)

The mailx interface (per POSIX) explicitly specifies that -s is subject. The virtual indicates that we just want something that complies with the standard, available as /bin/mail.

>  1. there is quite a few case where it is actually redundant with the local
> setup (think networked syslog).
So it's one package. It does not mail you unless you explicitly use the -m option to smartd.

>  2. mailx is only default on solaris
See the POSIX specification comments above.

>  3. there is no reason to make daemon installation dependant on a specific 
> it's imho up to the admin to write a script named mail that does what he wants
> (eventually wrapping up the sendmail command) or to install mailx MUA.
It's a virtual, not a specific MUA.

>  4. in any case, if the defined mail command fails, smartd will write something to syslog.
See bug 282371: "The problem is that the smartd daemon silently fails and doesn't send any warning emails."

If you're really being sticky about this dep, then please provide a patch to make smartd use the /usr/bin/sendmail binary directly. You'll have to provide the subject and other headers on stdin instead of via the exec arguments.

But I think that's just being ridiculous. Every machine has a MTA on it, having the mailx wrapper for the /usr/bin/sendmail is pretty common as well.
Comment 22 Gilles Dartiguelongue (RETIRED) gentoo-dev 2009-08-31 20:03:59 UTC
Created attachment 202820 [details]
mailx.sh

Found this wrapper script at [1] that seems to do the job I would need mailx for, for smarttools. Thanks for considering.

[1] http://lists2.linuxjournal.com/pipermail/linux-list/2003-November/018495.html
Comment 23 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-08-31 20:42:52 UTC
eva: package up that script as a trivial mailx?
Comment 24 Dennis Nezic 2010-02-12 14:46:19 UTC
Currently the ebuild forces the user to EITHER have a useless "minimal" installation (with no daemon), OR mailx (which I don't have or need) forced down their throats (or emerge --no-deps :b).

I suggest we either have "minimal" also install smartd (it gets compiled either way!) or introduce another USE flag to control mailx emerging.
Comment 25 C. Wijtmans 2013-08-09 10:12:26 UTC
Please remove the minimal useflag, it is undescriptive. And with it globally disabled it automatically pulls in mailx while this has nothing to do with the smart tools, it is not a config flag and it doesnt link to mailx. So please remove it.