summaryrefslogtreecommitdiff
path: root/src/machine/machine.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-03 12:48:51 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-03 12:51:07 +0200
commit206e7a5f7b55ac61188efd895e65ab26e478cbb2 (patch)
treee67415e2fd5fd8aa281548200cc5fd327c1e3b97 /src/machine/machine.c
parent37520c1bec9a92adbe02fceaece588a7aa2fea2b (diff)
machined: don't force terminate registered machines
When a machine is registered in machined with CreateMachine it is OK to kill the machine when it is terminated, but when an existing unit is simply registered via RegisterMachine we shouldn't do that, as the unit is controlled by somebody else.
Diffstat (limited to 'src/machine/machine.c')
-rw-r--r--src/machine/machine.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 0b0d45bb26..c0fa1b24b6 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -360,10 +360,12 @@ static int machine_stop_scope(Machine *m) {
if (!m->unit)
return 0;
- r = manager_stop_unit(m->manager, m->unit, &error, &job);
- if (r < 0) {
- log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
- return r;
+ if (!m->registered) {
+ r = manager_stop_unit(m->manager, m->unit, &error, &job);
+ if (r < 0) {
+ log_error("Failed to stop machine scope: %s", bus_error_message(&error, r));
+ return r;
+ }
}
free(m->scope_job);