[CentOS] systemctl (again)

Jonathan Billings billings at negate.org
Sat Apr 4 17:40:35 UTC 2015



On April 4, 2015 12:14:08 PM EDT, Pete Travis <lists at petetravis.com> wrote:
>On Apr 4, 2015 7:55 AM, "J Martin Rushton"
><martinrushton56 at btinternet.com>
>wrote:
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Thanks Andrew.
>>
>> One more problem solved, as I discovered last thing yesterday there
>> was a missing "[Install]".  Using your copy of the httpd service I
>> cut-and-pasted it onto the end of the service file you'd given me
>> earlier and at last was able to load the service.  It wouldn't run,
>> but at least it was some progress.
>>
>> I ran systemctl daemon-reload and rebooted.
>>
>> It is still failing though:
>>
>>         # systemctl status timidity
>>         timidity.service - timidity daemon
>>            Loaded: loaded (/etc/systemd/system/timidity.service;
>enabled)
>>            Active: failed (Result: exit-code) since Sat ...
>>           Process: 955 ExecStop=/bin/kill -s TERM $MAINPID
>(code=exited,
>> status=1/FAILURE)
>>           Process: 790 ExecStart=/usr/bin/timidity -iAD (code=exited,
>> status=0/SUCCESS)
>>          Main PID: 790 (code=exited, status=0/SUCCESS)
>>
>
><snip>
>
>The process exited, so systemd thinks the service has exited.  You have
>a
>'-D' option, which probably means daemonize, but you haven't set an
>appropriate Type declaration in the service file.
>
>If the service offers it, the best way to do simple services with
>systemd
>is with *foreground* options in ExecStart.  Then set Type=simple.
>STDOUT/STDERR all goes to the journal, making it easier to see what
>happens
>if the service legitimately fails.
>
>Take a look at packaged files in /usr/lib/systemd/system - plenty of
>examples to work from.
>
>--Pete
>_______________________________________________
>CentOS mailing list
>CentOS at centos.org
>http://lists.centos.org/mailman/listinfo/centos

Is $MAINPID defined in your pidfile?

It sounds to me like only the 'kill' is exiting with a non-zero exit code because the variable is undefined.

-- 
Jonathan Billings <billings at negate.org>


More information about the CentOS mailing list