summaryrefslogtreecommitdiff
path: root/src/core/dbus-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-17 14:07:38 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-17 17:32:49 +0100
commit97329d201064dcfb839a66e5933623f03d87eae6 (patch)
tree30edb9b96b526c63401f0ee7fb3a07acd6f897c2 /src/core/dbus-manager.c
parent0f13f3bd7918b84955eaa0ceeea0f964877a93f7 (diff)
core: dispatch load queue each time we set up a transient units
manager_load_unit() will dispatch the load queue anyway, but let's make sure we also dispatch it immediately, after truning a unit into a transient one and loading the properties from the message. That way the know about the validity of the unit before we begin processing the next auxiliary unit.
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r--src/core/dbus-manager.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 693d93f3fe..4d730290b2 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -677,6 +677,9 @@ static int transient_unit_from_message(
if (r < 0)
return r;
+ /* Now load the missing bits of the unit we just created */
+ manager_dispatch_load_queue(m);
+
*unit = u;
return 0;
@@ -687,8 +690,6 @@ static int transient_aux_units_from_message(
sd_bus_message *message,
sd_bus_error *error) {
- Unit *u;
- char *name = NULL;
int r;
assert(m);
@@ -699,20 +700,17 @@ static int transient_aux_units_from_message(
return r;
while ((r = sd_bus_message_enter_container(message, 'r', "sa(sv)")) > 0) {
+ const char *name = NULL;
+ Unit *u;
+
r = sd_bus_message_read(message, "s", &name);
if (r < 0)
return r;
r = transient_unit_from_message(m, message, name, &u, error);
- if (r < 0 && r != -EEXIST)
+ if (r < 0)
return r;
- if (r != -EEXIST) {
- r = unit_load(u);
- if (r < 0)
- return r;
- }
-
r = sd_bus_message_exit_container(message);
if (r < 0)
return r;
@@ -763,13 +761,6 @@ static int method_start_transient_unit(sd_bus_message *message, void *userdata,
if (r < 0)
return r;
- /* And load this stub fully */
- r = unit_load(u);
- if (r < 0)
- return r;
-
- manager_dispatch_load_queue(m);
-
/* Finally, start it */
return bus_unit_queue_job(message, u, JOB_START, mode, false, error);
}