<div dir="ltr">The main process does not show up in the ps and only the forked process shows up.  <div><br></div><div>The systemd-cgls shows</div><div><br></div><div><div>│   ├─session-14613.scope</div><div>│   │ ├─ 1577 sshd: root@pts/4</div><div>│   │ ├─ 1676 -bash</div><div>│   │ ├─16792 systemctl start smartd</div><div>│   │ └─16793 /usr/bin/systemd-tty-ask-password-agent --watch</div></div><div><br></div><div><br></div><div><div>└─system.slice</div><div>  ├─smartd.service</div><div>  │ └─16800 /usr/sbin/smartd --interval=3600 --configfile=/etc/smartd.conf</div></div><div><br></div><div>I think the PIDFile is optional.  Commenting out the PIDfile line does not help.</div><div><br></div><div>What else can I try?</div><div><br></div><div>Thanks,</div><div>-Al</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 10:57 AM, Andrei Borzenkov <span dir="ltr"><<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">В Thu, 2 Apr 2015 10:43:00 -0700<br>
Al Lau <<a href="mailto:lauatic@gmail.com">lauatic@gmail.com</a>> пишет:<br>
<div><div class="h5"><br>
> Hi,<br>
><br>
> I am seeking help and advise on troubleshooting the starting of the smartd<br>
> daemon.  The /usr/sbin/smartd comes from the smartmontools version 6.3.<br>
><br>
> The /usr/lib/systemd/system/smartd.service file looks like this<br>
><br>
> # cat /usr/lib/systemd/system/smartd.service<br>
> [Unit]<br>
> Description=Self Monitoring and Reporting Technology (SMART) Daemon<br>
> Documentation=man:smartd(8) man:smartd.conf(5)<br>
> After=syslog.target<br>
><br>
> [Service]<br>
> Type=forking<br>
> PIDFile=/run/smartd.pid<br>
> ExecStartPre=/bin/rm -f /run/smartd.pid<br>
> EnvironmentFile=/etc/sysconfig/smartmontools<br>
> ExecStart=/usr/sbin/smartd $smartd_opts<br>
> ExecReload=/bin/kill -HUP $MAINPID<br>
> StandardOutput=syslog<br>
><br>
> [Install]<br>
> WantedBy=multi-user.target<br>
><br>
> When "systemctl start smartd.service" is called, the process forks into a<br>
> daemon.  The problem I'm seeing is that the forked process received a<br>
> SIGTERM signal and exited.  How do I resolve this so that the forked<br>
> process would not get terminated.<br>
><br>
> # systemctl status smartd.service<br>
> smartd.service - Self Monitoring and Reporting Technology (SMART) Daemon<br>
>    Loaded: loaded (/usr/lib/systemd/system/smartd.service; enabled)<br>
>    Active: failed (Result: timeout) since Thu 2015-04-02 17:19:49 GMT; 4min<br>
> 39s ago<br>
>      Docs: man:smartd(8)<br>
>            man:smartd.conf(5)<br>
>   Process: 7456 ExecStart=/usr/sbin/smartd $smartd_opts (code=exited,<br>
> status=0/SUCCESS)<br>
>   Process: 7454 ExecStartPre=/bin/rm -f /run/smartd.pid (code=exited,<br>
> status=0/SUCCESS)<br>
>  Main PID: 1075 (code=exited, status=0/SUCCESS)<br>
><br>
> Apr 02 17:18:20 007 smartd[7456]: Device: /dev/bus/0 [megaraid_disk_19],<br>
> opened<br>
> Apr 02 17:18:20 007 smartd[7456]: Device: /dev/bus/0 [megaraid_disk_19],<br>
> [TOSHIBA  MG03SCA300       5702], lu ....00 TB<br>
> Apr 02 17:18:20 007 smartd[7456]: Device: /dev/bus/0 [megaraid_disk_19], is<br>
> SMART capable. Adding to "monitor" list.<br>
> Apr 02 17:18:20 007 smartd[7456]: Monitoring 0 ATA and 12 SCSI devices<br>
> Apr 02 17:18:21 007 systemd[1]: PID file /run/smartd.pid not readable<br>
> (yet?) after start.<br>
> Apr 02 17:18:21 007 smartd[7463]: smartd has fork()ed into background mode.<br>
> New PID=7463.<br>
> Apr 02 17:19:49 007 systemd[1]: smartd.service operation timed out.<br>
> Terminating.<br>
<br>
</div></div>There are to possibilities<br>
<br>
- smartd main process does not exit after fork. Check with systemd-cgls<br>
  immediately after systemctl start.<br>
- PID file is not created with path systemd expects<br>
<div class="HOEnZb"><div class="h5"><br>
> Apr 02 17:19:49 007 smartd[7463]: smartd received signal 15: Terminated<br>
> Apr 02 17:19:49 007 systemd[1]: Failed to start Self Monitoring and<br>
> Reporting Technology (SMART) Daemon.<br>
> Apr 02 17:19:49 007 systemd[1]: Unit smartd.service entered failed state.<br>
> Hint: Some lines were ellipsized, use -l to show in full.<br>
> #<br>
><br>
> To verify, I take the "/usr/sbin/smartd $smartd_opts" and run it from the<br>
> command line.  The smartd daemon forks and the daemon process stays up as<br>
> expected.<br>
><br>
> Thanks,<br>
> -Al<br>
<br>
</div></div></blockquote></div><br></div>