Can someone let me know the following about systemd service shutdown sequence
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.
Does TimeoutStopSec
take into account ExecStop
and all ExecPostStop
?
This has been answered in systemd email thread. Posting the answer below
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.