diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-10-29 09:47:57 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-10-29 10:54:45 +0100 |
commit | 0bb0a9faa7a9be917255648dcbc4b13132d90161 (patch) | |
tree | d6ad4086d2a821837ad5433aefbd38f8278bd131 /src/nspawn/nspawn-register.c | |
parent | ef8ff92e8ae014d352de381ff0a83e25e6f00efb (diff) | |
download | systemd-0bb0a9faa7a9be917255648dcbc4b13132d90161.tar.gz |
nspawn: when stopping the machine, just deregister the machine
We already shut the machine down ourselves (and pid1 will also do
cleanup for us after we exit if anything was left behind). No need for
systemd-machined to try to stop the unit too.
(This calls the new machined method. If we are running against an older
machined, we will not deregister the machine. If we are simply exiting,
machined should notice that the unit is gone on its own. If we are restarting,
we will fail to register the machine after restart and fail. But this case
was already broken, because machined would create a stop job, breaking the
restart. So not doing anything with old machined should not make anything
more broken than it already is.)
Fixes #13766.
Diffstat (limited to 'src/nspawn/nspawn-register.c')
-rw-r--r-- | src/nspawn/nspawn-register.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nspawn/nspawn-register.c b/src/nspawn/nspawn-register.c index 8e2c329665..7541c56d8f 100644 --- a/src/nspawn/nspawn-register.c +++ b/src/nspawn/nspawn-register.c @@ -209,7 +209,7 @@ int register_machine( return 0; } -int terminate_machine( +int unregister_machine( sd_bus *bus, const char *machine_name) { @@ -223,13 +223,13 @@ int terminate_machine( "org.freedesktop.machine1", "/org/freedesktop/machine1", "org.freedesktop.machine1.Manager", - "TerminateMachine", + "UnregisterMachine", &error, NULL, "s", machine_name); if (r < 0) - log_debug("Failed to terminate machine: %s", bus_error_message(&error, r)); + log_debug("Failed to unregister machine: %s", bus_error_message(&error, r)); return 0; } |