1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-07 17:17:44 +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 0790f4e45f2f8c094bf929aa1fcaf4c7e9dbb001)
(cherry picked from commit 6f346ef75635b549166d1be04b1dcb620f1b724c)
(cherry picked from commit 85804e690d)
(cherry picked from commit 342c67d8ab)
(cherry picked from commit 3c585568e7)
This commit is contained in:
Lennart Poettering 2024-11-27 10:26:04 +01:00 committed by Luca Boccassi
parent 43f941cb2b
commit d764298f15

View File

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