Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1029210: smartmontools.service fails since bookworm

785 views
Skip to first unread message

Harald Dunkel

unread,
Jan 19, 2023, 12:40:03 PM1/19/23
to
Package: smartmontools
Version: 7.3-1+b1

smartmontools.service fails, if there is nothing to monitor. Sample:

root@srvl065:~# systemctl status smartmontools
x smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon
Loaded: loaded (/lib/systemd/system/smartmontools.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Thu 2023-01-19 12:06:21 CET; 5h 59min ago
Docs: man:smartd(8)
man:smartd.conf(5)
Process: 13278 ExecStart=/usr/sbin/smartd -n $smartd_opts (code=exited, status=17)
Main PID: 13278 (code=exited, status=17)
Status: "No devices to monitor"
CPU: 36ms

Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Device: /dev/sda, IE (SMART) not enabled, skip device
Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Try 'smartctl -s on /dev/sda' to turn on SMART features
Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Device: /dev/sdb, opened
Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Device: /dev/sdb, [LSI 9750-4i DISK 5.12], lu id: 0x600050e0dce50d007c020000ad720000, S/N: 03019314DCE50D007C02, 137 GB
Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Device: /dev/sdb, IE (SMART) not enabled, skip device
Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Try 'smartctl -s on /dev/sdb' to turn on SMART features
Jan 19 12:06:21 srvl065.ac.aixigo.de smartd[13278]: Unable to monitor any SMART enabled devices. Try debug (-d) option. Exiting...
Jan 19 12:06:21 srvl065.ac.aixigo.de systemd[1]: smartmontools.service: Main process exited, code=exited, status=17/n/a
Jan 19 12:06:21 srvl065.ac.aixigo.de systemd[1]: smartmontools.service: Failed with result 'exit-code'.
Jan 19 12:06:21 srvl065.ac.aixigo.de systemd[1]: Failed to start Self Monitoring and Reporting Technology (SMART) Daemon.


I saw that this is an experimental feature, but I wonder what this could
be good for? IMHO smartmontools should work out of the box, even if there
are no disks, as it does for Bullseye.


Regards
Harri

Christian Franke

unread,
Apr 10, 2023, 10:00:05 AM4/10/23
to
Possible fix for the package: Add '-q nodev0' or '-q never' to ExecStart
in smartmontools.service.

Workaround for users: Add one of these to smartd_opts in
/etc/default/smartmontools.

Option '-q nodev0' is available since smartmontools 7.3. Then smartd
will exit with status 0 instead of 17 (default '-q nodev') if there are
no devices to monitor. Systemd should no longer report this as a failed
service.

With '-q never', smartd will keep running and does nothing. This was the
default for '-q' in some previous versions of (only!) the Debian
package. This Debian-specific patch was reverted later, see:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1006630

Regards,

Christian
smartmontools.org

Alban Browaeys

unread,
Jun 12, 2023, 9:20:04 PM6/12/23
to

Even with "-q nodev0" the service ends up in a failed state (but now
with an exit status of 0/SUCCESS)

sudo systemctl status smartmontools
× smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon
Loaded: loaded (/lib/systemd/system/smartmontools.service; enabled; preset: enabled)
Active: failed (Result: protocol) since Tue 2023-06-13 03:07:54 CEST; 2s ago
Docs: man:smartd(8)
man:smartd.conf(5)
Process: 4072 ExecStart=/usr/sbin/smartd -n $smartd_opts (code=exited, status=0/SUCCESS)
Main PID: 4072 (code=exited, status=0/SUCCESS)
Status: "No devices to monitor"
CPU: 29ms

juin 13 03:07:54 hercule systemd[1]: Starting smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon...
juin 13 03:07:54 hercule smartd[4072]: smartd 7.3 2022-02-28 r5338 [aarch64-linux-6.2.0-rc3-meson64] (local build)
juin 13 03:07:54 hercule smartd[4072]: Copyright (C) 2002-22, Bruce Allen, Christian Franke, www.smartmontools.org
juin 13 03:07:54 hercule smartd[4072]: Opened configuration file /etc/smartd.conf
juin 13 03:07:54 hercule smartd[4072]: Drive: DEVICESCAN, implied '-a' Directive on line 21 of file /etc/smartd.conf
juin 13 03:07:54 hercule smartd[4072]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
juin 13 03:07:54 hercule smartd[4072]: In the system's table of devices NO devices found to scan
juin 13 03:07:54 hercule systemd[1]: smartmontools.service: Failed with result 'protocol'.
juin 13 03:07:54 hercule smartd[4072]: Unable to monitor any SMART enabled devices. Try debug (-d) option. Exiting...
juin 13 03:07:54 hercule systemd[1]: Failed to start smartmontools.service - Self Monitoring and Reporting Technology (SMART) Daemon.

My storage as of now is only EMMC and SD. Though at time I can have
external USB HDDs to monitor with smartd.

Cheers,
Alban

Alban Browaeys

unread,
Jun 12, 2023, 11:00:06 PM6/12/23
to
A way to avoid the smartmontools systemd service to fail is to switch
the Service type from notify to forking. This after adding the "-q
nodev0" flag to the /etc/default/smartmontools smart_options variable.

systemctl edit smartmontools
[Service]
Type=forking

then systemctl daemon-reload
and restart samrtmontools/

Why is smartd of type notify? Does it send notification to systemd via
sd_notify?

Cheers,
Alban

Christian Franke

unread,
Jun 13, 2023, 5:20:04 AM6/13/23
to
Alban Browaeys wrote:
> Why is smartd of type notify? Does it send notification to systemd via
> sd_notify?

Yes, otherwise this would not appear in systemctl status output:

     Status: "No devices to monitor"

See 'man smartd' for details.

Unfortunately it does not properly work in conjunction with '-q nodev0'
because 'READY=1' is not notified before 'exit(0)' then. Systemd reports
"failed (Result: protocol)" in this case. This will be fixed in the next
release of smartmontools.

Regards,
Christian

Christian Franke

unread,
Jun 13, 2023, 9:40:04 AM6/13/23
to
0 new messages