1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +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.

(cherry picked from commit 0790f4e45f)
This commit is contained in:
Lennart Poettering 2024-11-27 10:26:04 +01:00 committed by Zbigniew Jędrzejewski-Szmek
parent d51236d833
commit 6f346ef756

View File

@ -5644,7 +5644,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)