SMART service not starting

turment

Dabbler
Joined
Feb 3, 2020
Messages
46
I have noticed that the SMART service is not working, even if enabled at startup.

Whenever I try to switch on by GUI, I receive the pop up "S.M.A.R.T. service failed to start."

On the physical console, it appears: "<date + time + machine name> smartd[6941]: Configuration file /usr/local/etc/smartd.conf has fatal syntax errors."

It contains:
/dev/ada0 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py root
/dev/ada1 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py root
/dev/ada2 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py root
/dev/ada3 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py root
/dev/ada5 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py root
/dev/ada4 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py
I have no USB devices: ada0-3 are the pool and ada4-5 are the bootable disks in mirror.

Help. :)
 

droeders

Contributor
Joined
Mar 21, 2016
Messages
179
I'm nearly positive the trailing 'root' on your entries is causing the failure. Try changing it to:

Code:
/dev/ada0 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py
/dev/ada1 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py
/dev/ada2 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py
/dev/ada3 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py
/dev/ada5 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py
/dev/ada4 -a -d removable -n never -W 0,0,0 -m root -M exec /usr/local/libexec/smart_alert.py


If you need that 'root' argument in smart_alert.py, and it corresponds to your '-m root' switch, you can use the SMARTD_ADDRESS environment variable within your smart_alert.py script instead. Hope this makes sense...

See here for more info:
 

turment

Dabbler
Joined
Feb 3, 2020
Messages
46
I'm nearly positive the trailing 'root' on your entries is causing the failure.
Thanks for your reply.

I tried to edit as you told and I keep on getting "S.M.A.R.T. service failed to start." when trying to launch from GUI.

Funny thing is:
Code:
root@Pluto[~]# ps aux | grep smart
root       1815   0.0  0.0   2520   2352  0  R+   15:48    0:00.00 grep smart
root@Pluto[~]# ps aux | grep smartd
root       1817   0.0  0.0   6696   2668  0  S+   15:48    0:00.00 grep smartd
root@Pluto[~]#

but it's not enabled on startup.

Do you think saving configuration and recreate a clean install would solve it or smartd.conf is a configuration backup saved file?
 

turment

Dabbler
Joined
Feb 3, 2020
Messages
46
Ok, there is update.

Whenever I save smartd.conf without the "root" at the end and I reboot, the smartd.conf reverts to "root" at the end of every line but last.

I have no idea how to correct this.
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
Funny thing is:
root@Pluto[~]# ps aux | grep smart
root 1815 0.0 0.0 2520 2352 0 R+ 15:48 0:00.00 grep smart
root@Pluto[~]# ps aux | grep smartd
root 1817 0.0 0.0 6696 2668 0 S+ 15:48 0:00.00 grep smartd
root@Pluto[~]#
but it's not enabled on startup.
Not so sure what's funny there, it shows smartd is not running.

A typical line here shows:
Code:
/dev/da1 -a -d removable -n never -W 0,0,0 -m t***@i****.com -M exec /usr/local/www/freenasUI/tools/smart_alert.py\
-s L/../../(7)/(01)\
 

Sure /dev/adaX are right? Here its /dev/daX but I'm not 100% sure if that might be due to HBA card vs directly connected.
I also notice the exec command is different. I'm running 11.2u7.
You could also try to comment out everything and keep just one line, this might be debugging easier. You can restart the smart daemon from the cli with service smartd-daemon restart

I reboot, the smartd.conf reverts to "root" at the end of every line but last.
The config file is recreated by the middleware upon each boot.
 

turment

Dabbler
Joined
Feb 3, 2020
Messages
46
Not so sure what's funny there, it shows smartd is not running.
My newbie FreeBSD knowledge.... I thought it was running...
Sure /dev/adaX are right?
Yep.
The config file is recreated by the middleware upon each boot.
So there must be something terribly wrong with middleware on 11.3 as it creates wrong smartd.conf.

Anyway, I rolled back to a previous configuration file that I save every week as backup and now smart seems to be running again. Nothing was changed since that backup and the system status that generates that nightmare. As a matter of fact, now no "root" is appended at the end of the line anymore. WTF.
 

droeders

Contributor
Joined
Mar 21, 2016
Messages
179
So there must be something terribly wrong with middleware on 11.3 as it creates wrong smartd.conf.

From everything I've read in the man page, the 'root' string should not be appended to those lines.

If it's really a 11.3 bug, I'd be surprised if you're the only one seeing it.
 

turment

Dabbler
Joined
Feb 3, 2020
Messages
46
If it's really a 11.3 bug, I'd be surprised if you're the only one seeing it.
It happened after I tried to send the pool to idle and set by GUI SMART service active not during idle.

Perhaps it is replicable but I won't risk my system again. :)
 
Top