diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-01-18 22:55:54 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-01-18 22:55:54 +0100 |
commit | ba035df230e41bf9d70ebb47915c9472b7884412 (patch) | |
tree | 37f5af1b2de9a93e15ee36ef080436619cfdbec9 /src/service.c | |
parent | 0058d7b91ca90ee2dc605298bc5bac9bef0ededf (diff) |
execute: make sending of SIGKILL on shutdown optional
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/service.c b/src/service.c index e4dfa40314..e765004e4f 100644 --- a/src/service.c +++ b/src/service.c @@ -2712,8 +2712,14 @@ static void service_timer_event(Unit *u, uint64_t elapsed, Watch* w) { break; case SERVICE_STOP_SIGTERM: - log_warning("%s stopping timed out. Killing.", u->meta.id); - service_enter_signal(s, SERVICE_STOP_SIGKILL, false); + if (s->exec_context.send_sigkill) { + log_warning("%s stopping timed out. Killing.", u->meta.id); + service_enter_signal(s, SERVICE_STOP_SIGKILL, false); + } else { + log_warning("%s stopping timed out. Skipping SIGKILL.", u->meta.id); + service_enter_stop_post(s, false); + } + break; case SERVICE_STOP_SIGKILL: @@ -2731,8 +2737,14 @@ static void service_timer_event(Unit *u, uint64_t elapsed, Watch* w) { break; case SERVICE_FINAL_SIGTERM: - log_warning("%s stopping timed out (2). Killing.", u->meta.id); - service_enter_signal(s, SERVICE_FINAL_SIGKILL, false); + if (s->exec_context.send_sigkill) { + log_warning("%s stopping timed out (2). Killing.", u->meta.id); + service_enter_signal(s, SERVICE_FINAL_SIGKILL, false); + } else { + log_warning("%s stopping timed out (2). Skipping SIGKILL. Entering failed mode.", u->meta.id); + service_enter_dead(s, false, true); + } + break; case SERVICE_FINAL_SIGKILL: |