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!
added virtual/mailx to RDEPEND, thanks for the report
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.
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.
+1 for use flag, I'd be annoyed if I didn't need it =)
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!
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)
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" +}
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?
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
+1 - please remove this.
fixed properly. Thank you all and especially chainsaw.
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.
*** Bug 282371 has been marked as a duplicate of this bug. ***
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.
Committed now.
Does anyone care to answer comment #12?
(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 )"
(In reply to comment #17) Ah, allright. Thank you. :) I should learn to write ebuilds. Then I could contribute this myself. ^^
*** Bug 282884 has been marked as a duplicate of this bug. ***
reopening bug per duplicated bug. Please find there comments against changes done in 5.38-r1.
(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.
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
eva: package up that script as a trivial mailx?
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.
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.