diff options
author | Anita Zhang <the.anitazha@gmail.com> | 2020-01-25 16:46:16 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-03-26 14:32:37 +0100 |
commit | e641811c659219154a837e264f61598014cea431 (patch) | |
tree | dec73af762d032b91e509a844cbc924bb6416133 /src | |
parent | 02f826c31a60253f14b858b4fd31e1b3c363730e (diff) | |
download | systemd-e641811c659219154a837e264f61598014cea431.tar.gz |
core: transition to FINAL_SIGTERM state after ExecStopPost=
Fixes #14566
(cherry picked from commit c1566ef0d22ed786b9ecf4c476e53b8a91e67578)
(cherry picked from commit b7f2308bda4942d1b8e10250db6836fe4fc0d8b8)
(cherry picked from commit 49e7c3b617613306211cc8e28e68d4e5be8fbec4)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/service.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c index 98aa9b9292..72b579a32c 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3492,6 +3492,12 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; case SERVICE_STOP_POST: + + if (control_pid_good(s) <= 0) + service_enter_signal(s, SERVICE_FINAL_SIGTERM, f); + + break; + case SERVICE_FINAL_SIGTERM: case SERVICE_FINAL_SIGKILL: @@ -3641,6 +3647,10 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) { break; case SERVICE_STOP_POST: + if (main_pid_good(s) <= 0) + service_enter_signal(s, SERVICE_FINAL_SIGTERM, f); + break; + case SERVICE_FINAL_SIGTERM: case SERVICE_FINAL_SIGKILL: if (main_pid_good(s) <= 0) |