nspawn: rework how we allocate/kill scopes

Fixes: #6347
This commit is contained in:
Lennart Poettering
2018-11-09 17:08:59 +01:00
parent df61bc5e4a
commit 1d78fea2d6
3 changed files with 70 additions and 3 deletions
+6 -2
View File
@@ -4129,8 +4129,12 @@ static int run(int master,
putc('\n', stdout);
/* Kill if it is not dead yet anyway */
if (arg_register && !arg_keep_unit && bus)
terminate_machine(bus, arg_machine);
if (bus) {
if (arg_register)
terminate_machine(bus, arg_machine);
else if (!arg_keep_unit)
terminate_scope(bus, arg_machine);
}
/* Normally redundant, but better safe than sorry */
(void) kill(*pid, SIGKILL);