From: Lennart Poettering Date: Wed, 27 Nov 2024 09:26:04 +0000 (+0100) Subject: nspawn: don't try to unregister a machine we never registered X-Git-Tag: v256.9~6 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=6f346ef75635b549166d1be04b1dcb620f1b724c;p=systemd%2F.git 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) --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 4e15112add..459caa7c58 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -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)