[systemd-devel] systemd and smartd daemon

Reindl Harald h.reindl at thelounge.net
Thu Apr 2 11:01:06 PDT 2015



>> I am seeking help and advise on troubleshooting the starting of the smartd
>> daemon.  The /usr/sbin/smartd comes from the smartmontools version 6.3.

and the systemd unit si from where?

>> The /usr/lib/systemd/system/smartd.service file looks like this

and is wrong

>> # cat /usr/lib/systemd/system/smartd.service
>> [Unit]
>> Description=Self Monitoring and Reporting Technology (SMART) Daemon
>> Documentation=man:smartd(8) man:smartd.conf(5)
>> After=syslog.target
>>
>> [Service]
>> Type=forking
>> PIDFile=/run/smartd.pid
>> ExecStartPre=/bin/rm -f /run/smartd.pid
>> EnvironmentFile=/etc/sysconfig/smartmontools
>> ExecStart=/usr/sbin/smartd $smartd_opts
>> ExecReload=/bin/kill -HUP $MAINPID
>> StandardOutput=syslog
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> When "systemctl start smartd.service" is called, the process forks into a
>> daemon.  The problem I'm seeing is that the forked process received a
>> SIGTERM signal and exited.  How do I resolve this so that the forked
>> process would not get terminated

no, it don't forke which is the reason it got killed, look below: the 
fedora systemd-unit is using default which implies Type=simple

[root at srv-rhsoft:~]$ cat /usr/lib/systemd/system/smartd.service
[Unit]
Description=Self Monitoring and Reporting Technology (SMART) Daemon
After=syslog.target

[Service]
EnvironmentFile=-/etc/sysconfig/smartmontools
ExecStart=/usr/sbin/smartd -n $smartd_opts
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=syslog

[Install]
WantedBy=multi-user.target

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150402/7f735528/attachment.sig>


More information about the systemd-devel mailing list