Bug 921092

Summary: smartd_warning.sh prints error when called by smartd
Product: [openSUSE] openSUSE Distribution Reporter: Marc Schütz <schuetzm>
Component: OtherAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: 13.2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 921075    

Description Marc Schütz 2015-03-06 15:05:02 UTC
My /etc/smartd.conf contains:

DEVICESCAN -d removable -m root,@ALL -M test -M exec /etc/smartd_warning.sh

When I start smartd.service, it tries to send the test email as requested. It calls the warning script with the arguments `-s "SMART error (EmailTest) detected on host: kaim root"`, but the script doesn't accept arguments and aborts.
Comment 1 Stanislav Brabec 2015-03-09 16:12:47 UTC
You are using this feature in an incorrect way.

"-M exec /etc/smartd_warning.sh" means:

    exec  PATH - run the executable PATH instead of the default mail
    command, when smartd needs to send email.  PATH must point to an
    executable binary file or script.

You are not (re)defining warning script, as you intended. You are redefining mailer to something, which is definitely not a mailer.

What happens for you:
smartd calls /etc/smartd_warning.sh to send a test mail

/etc/smartd_warning.sh formats a mail and attempts to send the mail using /etc/smartd_warning.sh as mailer.

Hopefully for you, /etc/smartd_warning.sh does not accept args, so it returns with error. If it would continue, you would get a fork bomb.

All warnings are directed to /etc/smartd_warning.sh, and there is no option to change path of the warning script.

Everything works for me. Just try:

DEVICESCAN -d removable -m root,@ALL -M test


The only thing that can be improved, is a creation of /etc/smartd_warning.d for plugins. I'll do it in the next commit.