summaryrefslogtreecommitdiff
path: root/src/machine/machine.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-18 04:43:08 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-18 04:48:26 +0100
commitde58a50e24a0d55e3bbcc77f8f6170a7322acf52 (patch)
tree92306bb846d9e1af42b60376f652042c7eb0025f /src/machine/machine.c
parentdf23374071f497831c4d25076a12b1da41054271 (diff)
machined: fix Kill() bus call on machine objects when "what" is specified as "leader"
Diffstat (limited to 'src/machine/machine.c')
-rw-r--r--src/machine/machine.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 4596a80838..9a5cc9a63c 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -410,7 +410,15 @@ int machine_kill(Machine *m, KillWho who, int signo) {
if (!m->unit)
return -ESRCH;
- return manager_kill_unit(m->manager, m->unit, who, signo, NULL);
+ if (who == KILL_LEADER) {
+ /* If we shall simply kill the leader, do so directly */
+
+ if (kill(m->leader, signo) < 0)
+ return -errno;
+ }
+
+ /* Otherwise make PID 1 do it for us, for the entire cgroup */
+ return manager_kill_unit(m->manager, m->unit, signo, NULL);
}
static const char* const machine_class_table[_MACHINE_CLASS_MAX] = {