[systemd-devel] How does KillSignal interact with TimeoutStopSec in systemd?

Andrei Borzenkov arvidjaar at gmail.com
Tue Apr 28 16:49:15 UTC 2020


27.04.2020 08:43, Debraj Manna пишет:
> Can someone let me know the following about systemd service shutdown
> sequence
> 
>     1.
> 
>     If I have specified KillSignal=SIGTERM then how does this interact this
>     TimeoutStopSec ? Does this mean that during shutdown of service, first
>     SIGTERM will be sent and if the service is still running after
>     TimeoutStopSec SIGKILL will be sent (if SendSIGKILL is set to yes? I am
>     asking about the case where nothing is specified in ExecStop.

Yes, that's correct

>     2.
> 
>     Does TimeoutStopSec take into account ExecStop and all ExecPostStop?
> 

TimeoutStopSec is for every command. If ExecStopPost command fails (or 
times out) subsequent commands are not executed, but if each command 
requires almost TimeoutStopSec time, total execution time will be close 
to ExecStopPost commands multiplied by TimeoutStopSec.


More information about the systemd-devel mailing list