Merge pull request #13866 from keszybz/nspawn-restarts
Make 'machinectl reboot' functional
This commit is contained in:
+6
-6
@@ -4618,12 +4618,8 @@ static int run_container(
|
||||
}
|
||||
|
||||
/* Kill if it is not dead yet anyway */
|
||||
if (bus) {
|
||||
if (arg_register)
|
||||
terminate_machine(bus, arg_machine);
|
||||
else if (!arg_keep_unit)
|
||||
terminate_scope(bus, arg_machine);
|
||||
}
|
||||
if (!arg_register && !arg_keep_unit && bus)
|
||||
terminate_scope(bus, arg_machine);
|
||||
|
||||
/* Normally redundant, but better safe than sorry */
|
||||
(void) kill(*pid, SIGKILL);
|
||||
@@ -4631,6 +4627,10 @@ static int run_container(
|
||||
r = wait_for_container(*pid, &container_status);
|
||||
*pid = 0;
|
||||
|
||||
/* Tell machined that we are gone. */
|
||||
if (bus)
|
||||
(void) unregister_machine(bus, arg_machine);
|
||||
|
||||
if (r < 0)
|
||||
/* We failed to wait for the container, or the container exited abnormally. */
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user