1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-21 18:03:41 +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 85804e690d3531ca7582e7b9f52ca9cb1b9c9b6c)
This commit is contained in:
Lennart Poettering 2024-11-27 10:26:04 +01:00 committed by Luca Boccassi
parent b168d6f8a4
commit 342c67d8ab

View File

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