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/socket.c | |
parent | 0058d7b91ca90ee2dc605298bc5bac9bef0ededf (diff) |
execute: make sending of SIGKILL on shutdown optional
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/socket.c b/src/socket.c index cb38ab3d69..6ec49de466 100644 --- a/src/socket.c +++ b/src/socket.c @@ -1688,8 +1688,13 @@ static void socket_timer_event(Unit *u, uint64_t elapsed, Watch *w) { break; case SOCKET_STOP_PRE_SIGTERM: - log_warning("%s stopping timed out. Killing.", u->meta.id); - socket_enter_signal(s, SOCKET_STOP_PRE_SIGKILL, false); + if (s->exec_context.send_sigkill) { + log_warning("%s stopping timed out. Killing.", u->meta.id); + socket_enter_signal(s, SOCKET_STOP_PRE_SIGKILL, false); + } else { + log_warning("%s stopping timed out. Skipping SIGKILL. Ignoring.", u->meta.id); + socket_enter_stop_post(s, false); + } break; case SOCKET_STOP_PRE_SIGKILL: @@ -1703,8 +1708,13 @@ static void socket_timer_event(Unit *u, uint64_t elapsed, Watch *w) { break; case SOCKET_FINAL_SIGTERM: - log_warning("%s stopping timed out (2). Killing.", u->meta.id); - socket_enter_signal(s, SOCKET_FINAL_SIGKILL, false); + if (s->exec_context.send_sigkill) { + log_warning("%s stopping timed out (2). Killing.", u->meta.id); + socket_enter_signal(s, SOCKET_FINAL_SIGKILL, false); + } else { + log_warning("%s stopping timed out (2). Skipping SIGKILL. Ignoring.", u->meta.id); + socket_enter_dead(s, false); + } break; case SOCKET_FINAL_SIGKILL: |