Bug 1954018

Summary: smartd cannot send alerts at all due to running with restricted capabilities
Product: [Fedora] Fedora Reporter: Tomáš Trnka <tomastrnka>
Component: smartmontoolsAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: mhlavink, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-30 11:04:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomáš Trnka 2021-04-27 12:58:21 UTC
Description of problem:
The default smartd_opts in /etc/sysconfig/smartmontools include the --capabilities argument, which makes smartd drop most privileges on startup. As documented in smartd(8), this disables all alerts (e-mails, messages to local consoles, possible plugins in /etc/smartmontools/smartd_warning.d/ like desktop notifications). The alert notification machinery (/etc/smartmontools/smartd_warning.sh) will simply never be run by smartd when --capabilities is enabled.

This makes smartd in the default configuration close to useless, because the only thing it does is write even critical alerts to the syslog, which most users do not monitor closely enough to notice a warning of an imminent disk failure before it is too late.

Version-Release number of selected component (if applicable):
smartmontools-7.2-2.fc32.x86_64

How reproducible:
Any time on demand

Steps to Reproduce:
1. Add "-M test" to the default uncommented DEVICESCAN line in /etc/smartmontools/smartd.conf to trigger a test alert
2. systemctl restart smartd.service

Actual results:
No alert is ever generated. Syslog messages like the following will be logged, pointing at the problem:

Device: /dev/sda [SAT], --capabilites is set, mail will be suppressed.
Device: /dev/nvme0, --capabilites is set, mail will be suppressed.

Expected results:
Syslog messages like the following, together with a warning e-mail and message to all consoles.

Executing test of /usr/libexec/smartmontools/smartdnotify to root ...
Test of /usr/libexec/smartmontools/smartdnotify to root: successful
Executing test of /usr/libexec/smartmontools/smartdnotify to root ...
Test of /usr/libexec/smartmontools/smartdnotify to root: successful


Additional info:
Removing the "--capabilities" argument from /etc/sysconfig/smartmontools and restarting smartd fixes the issue.

Comment 1 Fedora Program Management 2021-04-29 16:47:13 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Michal Hlavinka 2021-04-30 11:04:47 UTC

*** This bug has been marked as a duplicate of bug 1954015 ***