[systemd-devel] ExecStop required in service file?

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Dec 13 23:53:56 PST 2011


On 12/13/2011 11:33 PM, Michael D. Berger wrote:
>
>> -----Original Message-----
>> From: Lennart Poettering [mailto:lennart at poettering.net]
>> Sent: Tuesday, December 13, 2011 05:57
>> To: Michael D. Berger
>> Cc: systemd-devel at lists.freedesktop.org
>> Subject: Re: [systemd-devel] ExecStop required in service file?
>>
>> On Mon, 14.11.11 10:51, Michael D. Berger (m.d.berger at ieee.org) wrote:
>>
>>> On my F16_64, mySrvDaemon is a tcp/ip server involving posix
>>> threads, written in C++.  mySrvDaemon.service:
>>>
>>>   [Unit]
>>>   Description=Server Service
>>>   After=syslog.target network.target
>>>
>>>   [Service]
>>>   PIDFile=/var/lock/subsys/mySrvDaemon
>>>   Type=simple
>>>   ControlGroup=cpu:/
>>>   ExecStart=/usr/sbin/mySrvDaemon --daemon
>>>   ExecStop=/bin/kill -TERM $MAINPID
>>
>> Note that systemd sends TERM to all processes of a service anyway. An
>> ExecStop= line like this is hence fully redundant.
>>
>> Lennart
>>
>
> So if instead, I did:
>
> ExecStop=/bin/kill -9 $MAINPID
>
> would I get both TERM and KILL signals, or would I just get KILL?
You would get both, if the process lived long enough. Normally SIGTERM 
would destroy the process immediately, but it could survive if there's a 
kernel problem and the process is unkillable.

Best,
Zbyszek


More information about the systemd-devel mailing list