summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/kill.c1
-rw-r--r--src/core/kill.h1
-rw-r--r--src/core/unit.c3
3 files changed, 4 insertions, 1 deletions
diff --git a/src/core/kill.c b/src/core/kill.c
index ea947c23ae..4271346511 100644
--- a/src/core/kill.c
+++ b/src/core/kill.c
@@ -52,6 +52,7 @@ void kill_context_dump(KillContext *c, FILE *f, const char *prefix) {
static const char* const kill_mode_table[_KILL_MODE_MAX] = {
[KILL_CONTROL_GROUP] = "control-group",
[KILL_PROCESS] = "process",
+ [KILL_MIXED] = "mixed",
[KILL_NONE] = "none"
};
diff --git a/src/core/kill.h b/src/core/kill.h
index 41773f07ae..d5f125fa41 100644
--- a/src/core/kill.h
+++ b/src/core/kill.h
@@ -32,6 +32,7 @@ typedef enum KillMode {
/* The kill mode is a property of a unit. */
KILL_CONTROL_GROUP = 0,
KILL_PROCESS,
+ KILL_MIXED,
KILL_NONE,
_KILL_MODE_MAX,
_KILL_MODE_INVALID = -1
diff --git a/src/core/unit.c b/src/core/unit.c
index e5ea994e54..0ad679ba62 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -2966,7 +2966,7 @@ int unit_kill_context(
}
}
- if (c->kill_mode == KILL_CONTROL_GROUP && u->cgroup_path) {
+ if ((c->kill_mode == KILL_CONTROL_GROUP || (c->kill_mode == KILL_MIXED && sigkill)) && u->cgroup_path) {
_cleanup_set_free_ Set *pid_set = NULL;
/* Exclude the main/control pids from being killed via the cgroup */
@@ -2980,6 +2980,7 @@ int unit_kill_context(
log_warning_unit(u->id, "Failed to kill control group: %s", strerror(-r));
} else if (r > 0) {
wait_for_exit = true;
+
if (c->send_sighup) {
set_free(pid_set);