summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-28 20:46:33 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-28 21:34:23 +0200
commit1a2399e57d9f5943a508720aaddc87512a972378 (patch)
tree30c8d123cf5c4e2c9c1e393f28acd88f9c427086 /src/nspawn/nspawn.c
parent773ce3d89c25aa51b0fe9085bd0eb7ba5e50508b (diff)
nspawn: when run as a service, don't ask machined for terminatin of ourselves
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r--src/nspawn/nspawn.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 29652e00e5..05d2c71e45 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -2081,6 +2081,11 @@ static int terminate_machine(pid_t pid) {
if (!arg_register)
return 0;
+ /* If we are reusing the unit, then just exit, systemd will do
+ * the right thing when we exit. */
+ if (arg_keep_unit)
+ return 0;
+
r = sd_bus_default_system(&bus);
if (r < 0)
return log_error_errno(r, "Failed to open system bus: %m");