Opened 5 years ago

Closed 4 years ago

#1248 closed defect (worksforme)

smartd fails to start when no disks are present

Reported by: onlyjob Owned by:
Priority: minor Milestone:
Component: smartd Version: 7.0
Keywords: Cc:


As reported in
"smartd" fails to start on the system without disks (e.g. KVM).

It would be better to start the daemon anyway and wait for pluggable disks to appear.

This could help to prevent init system failures on attempted start of "smartd".

Change History (5)

comment:1 by Christian Franke, 5 years ago

Milestone: undecided

Did you try -q never (--quit=never) smartd command line option?

Please note that there is still no automatic rescan on hotplug events (see ticket #60). SIGHUP needs to be sent manually or by some external tool.

comment:2 by onlyjob, 5 years ago

Thank you, with "-q never" smartd starts successfully even without disks.

Any concerns regarding making "-q never" default?

in reply to:  2 comment:3 by Christian Franke, 4 years ago

Any concerns regarding making "-q never" default?

I guess no. It would wakeup each 30 minutes and does nothing.

Would the following enhancement be a mid-term alternative?

A new option (say -q nodev,0) allows to change the exit code from "found no devices to monitor" (17) to "success" (0). Then smartd would behave like a "oneshot" service if no SMART enabled devices are found.

comment:4 by onlyjob, 4 years ago

I see no harm in "doing nothing" every 30 minutes.

If we care to install and enable daemon then we expect it to run and wait for disks.
Failure to start just makes no sense to me.

I think daemon behaviour should be what's expected from daemon which is to continue running.

It would be dodgy if on some systems "smartd" behave properly and remain running while on other systems it would act like "oneshot" (i.e. start then exit).

From service management prospective there is nothing worse than daemon that terminates shortly after start.

Last edited 4 years ago by onlyjob (previous) (diff)

comment:5 by Christian Franke, 4 years ago

Milestone: undecided
Resolution: worksforme
Status: newclosed

The issue could be solved with command line option -q never. Then smartd will continue to run even if there are no devices to monitor (or if there are errors in the configuration file).

Note: See TracTickets for help on using tickets.