#1032469 smartmontools: startup takes too long for systemd

Package:
smartmontools
Source:
smartmontools
Description:
control and monitor storage systems using S.M.A.R.T.
Submitter:
Matthew Vernon
Date:
2023-04-10 13:06:03 UTC
Severity:
normal
#1032469#5
Date:
2023-03-07 16:08:22 UTC
From:
To:
Hi,

On some of our production servers with a lot of JBOD disks, smartd
takes so long to start up that systemd's default 90s timeout kicks in
and smartd gets killed. Example log extract:

Mar 07 14:15:10 ms-be2070 systemd[1]: Starting Self Monitoring and
Reporting Technology (SMART) Daemon...
[smartd starts monitoring disks]
Mar 07 14:16:40 ms-be2070 systemd[1]: smartmontools.service: start
operation timed out. Terminating.
Mar 07 14:16:40 ms-be2070 systemd[1]: smartmontools.service: Failed with
result 'timeout'.
Mar 07 14:16:40 ms-be2070 systemd[1]: Failed to start Self Monitoring
and Reporting Technology (SMART) Daemon.

I fixed this by adding a systemd override:
[Service]
TimeoutSec=300

And now all is good:

Mar 07 14:31:53 ms-be2070 systemd[1]: Starting Self Monitoring and
Reporting Technology (SMART) Daemon...
Mar 07 14:34:06 ms-be2070 systemd[1]: Started Self Monitoring and
Reporting Technology (SMART) Daemon.

Note the ~2 minute start time.

It seems to me that the default startup timeout ought to be long
enough to work "out of the box", so could the unit file we ship be
adjusted to set a sensible TimeoutSec value, please? 300s seems likely
to be enough.

Thanks,

Matthew

#1032469#10
Date:
2023-04-10 12:53:56 UTC
From:
To:
A note for upcoming smartmontools release 7.4:

It NOTIFY_SOCKET is set in environment, smartd 7.4 will sd_notify
"EXTEND_TIMEOUT_USEC=20000000" for each disk during device registration
and then for each disk during first device checks.No such calls will
occur after "READY=1" has been notified.

Regards,

Christian
smartmontools.org