1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-03 05:18:09 +03:00

nspawn: don't try to unregister a machine we never registered

When registering we condition this on "arg_register". Let's do the same
when unregistering, otherwise we might end up trying to unregister a
machine we never registered.
This commit is contained in:
Lennart Poettering 2024-11-27 10:26:04 +01:00 committed by Yu Watanabe
parent 92033d8fba
commit 0790f4e45f

View File

@ -5772,7 +5772,7 @@ static int run_container(
r = wait_for_container(TAKE_PID(*pid), &container_status);
/* Tell machined that we are gone. */
if (bus)
if (arg_register && bus)
(void) unregister_machine(bus, arg_machine);
if (r < 0)