Opened 5 years ago
Closed 5 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: |
Description
As reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=862908
"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 , 5 years ago
Milestone: | → undecided |
---|
follow-up: 3 comment:2 by , 5 years ago
Thank you, with "-q never" smartd starts successfully even without disks.
Any concerns regarding making "-q never" default?
comment:3 by , 5 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 , 5 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.
comment:5 by , 5 years ago
Milestone: | undecided |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
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).
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.