summaryrefslogtreecommitdiff
path: root/src/core/swap.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-29 14:58:04 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-29 17:46:47 +0100
commitac84d1fb5a7293df4f75544eedf148ba0bb4ec21 (patch)
treeeec35601f6ce583520e3a41076023624ed183160 /src/core/swap.c
parentc9cf047362cd8e4530c10bc7c2d6db988452305d (diff)
core: make sure to always go through both SIGTERM and SIGKILL states of units
Given that we now have KillMode=mixed where SIGTERM might kill a smaller set than SIGKILL we need to make sure to always go explicitly throught the SIGKILL state to get the right end result.
Diffstat (limited to 'src/core/swap.c')
-rw-r--r--src/core/swap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/swap.c b/src/core/swap.c
index 26141e6a33..d53cabef2a 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -712,7 +712,11 @@ static void swap_enter_signal(Swap *s, SwapState state, SwapResult f) {
goto fail;
swap_set_state(s, state);
- } else
+ } else if (state == SWAP_ACTIVATING_SIGTERM)
+ swap_enter_signal(s, SWAP_ACTIVATING_SIGKILL, SWAP_SUCCESS);
+ else if (state == SWAP_DEACTIVATING_SIGTERM)
+ swap_enter_signal(s, SWAP_DEACTIVATING_SIGKILL, SWAP_SUCCESS);
+ else
swap_enter_dead(s, SWAP_SUCCESS);
return;