Bug 2506055 - smartdnotify script executes premature exit 0 on critical SMART drive failures (CurrentPendingSector)
Summary: smartdnotify script executes premature exit 0 on critical SMART drive failure...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: smartmontools
Version: 44
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-07-22 10:43 UTC by Michal Hlavinka
Modified: 2026-08-22 01:12 UTC (History)
2 users (show)

Fixed In Version: smartmontools-7.5-9.fc44 smartmontools-7.5-9.fc43
Clone Of:
Environment:
Last Closed: 2026-08-18 01:11:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michal Hlavinka 2026-07-22 10:43:29 UTC
File with issue: /usr/libexec/smartmontools/smartdnotify

[Environment Context]
- OS: Fedora Workstation 44 (Sway spin, installed via Fedora Everything netinst ISO).
- User setup: Standard desktop/home user workstation (No root account created during install, single user leverages 'sudo').
- Network/Infra: Standalone local machine. No corporate environment, no centralized log monitoring agents (like Zabbix/Prometheus), and NO local mail server/MTA configured or installed by default.

[Detailed Description of the Bug]
The 'smartdnotify' script contains a flawed flow logic inside its 'case' statement. When the smartd daemon catches a critical hardware failure (e.g., "CurrentPendingSector", "OfflineUncorrectableSector"), it executes the script. 

The script starts by trying to pipe the message to the 'mail' command. Since standard Fedora desktop installations do not ship with a working local mail server out-of-the-box, this mail drop fails or disappears silently.

Immediately after the mail block, the script enters:
case "$SMARTD_FAILTYPE" in

Since critical drive failure strings are not explicitly matched in the case options (only "EmailTest", "Health", "Temperature", and "Usage" are matched), they fall into the wildcard (*) block, which executes a hard 'exit 0'.

Reproducible: Always

Steps to Reproduce:
Summary case 1 - SMARTD_FAILTYPE="CurrentPendingSector"
smartdnotify script executes premature exit 0 on critical SMART drive failures, preventing terminal wall notifications on headless systems

steps

0. open text tty console and log as user

1. Inspect the script logic at /usr/libexec/smartmontools/smartdnotify. Notice that inside the 'case "$SMARTD_FAILTYPE"' block, critical hardware failures fall into the wildcard (*) option, which executes a global 'exit 0'.

2. Simulate a critical hardware alert by exporting a critical failure type and calling the script manually:

export SMARTD_FAILTYPE="CurrentPendingSector"
export SMARTD_MESSAGE="Device: /dev/sda, 12 Currently unreadable (pending) sectors"
export SMARTD_FULLMESSAGE="Simulated critical hardware failure"
export SMARTD_SUBJECT="SMART error"
export SMARTD_ADDRESS="root"

/usr/libexec/smartmontools/smartdnotify

3. Check the exit status immediately after execution (echo $?). It returns 0.

4. Switch to any text tty console (e.g., Ctrl+Alt+F3). Observe that no 'wall' notification was printed to logged-in system administrators, meaning critical hardware alerts are completely silenced on headless systems if local mail is missing.

5. Observe that no desktop notification graphical popup (via mako/dunst/desktop notification daemons) appears on the user's active screen.

------------
Expected Results:
case 1 headless servers

For critical drive failures, the script should NOT exit prematurely inside the 'case' block. It should proceed to the end of the file and execute the 'wall -n' command. This ensures that system administrators logged into text TTYs or headless servers receive an immediate broadcast on their terminals warning them about imminent hardware degradation, even if the local mail subsystem is unconfigured.

Additional Information:
case 1 headless servers
The 'case' filtering logic inside /usr/libexec/smartmontools/smartdnotify should be redesigned to wrap ONLY the 'wall' command string configuration, instead of calling a global 'exit 0' that halts the entire script execution prematurely. This will allow critical hardware alerts to naturally reach the fallback notification commands at the bottom of the script.

Comment 1 noniferango 2026-07-28 12:01:39 UTC
See also: bug #2491190

Comment 2 Fedora Update System 2026-08-16 11:55:40 UTC
FEDORA-2026-eb5363b2a7 (smartmontools-7.5-9.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-eb5363b2a7

Comment 3 Fedora Update System 2026-08-16 11:55:43 UTC
FEDORA-2026-92cefb93ae (smartmontools-7.5-9.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-92cefb93ae

Comment 4 Fedora Update System 2026-08-17 01:30:17 UTC
FEDORA-2026-92cefb93ae has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-92cefb93ae`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-92cefb93ae

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2026-08-17 01:49:54 UTC
FEDORA-2026-eb5363b2a7 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-eb5363b2a7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-eb5363b2a7

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2026-08-18 01:11:41 UTC
FEDORA-2026-92cefb93ae (smartmontools-7.5-9.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2026-08-22 01:12:29 UTC
FEDORA-2026-eb5363b2a7 (smartmontools-7.5-9.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.