summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-14 16:22:22 +0200
committerLennart Poettering <lennart@poettering.net>2015-10-14 16:22:22 +0200
commit995c5e96cdf9e6054a4df04960253d897f4d7cc2 (patch)
treee5d4f336e7e2633579b818050b43d68bb87e441d
parent9ea79b459edef51e3ccc1ddde07c7b1399bed601 (diff)
core: log if the service to activate vanished before we activate it
Normally this shouldn't happen unless the daemon is reloaded. A similar check is already in place in socket.c for the socket activation case. This hopefully makes #1526 non-fatal, though it will not fix this, and there's something else to fix.
-rw-r--r--src/core/busname.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/busname.c b/src/core/busname.c
index 38becfc119..b85fce5f8d 100644
--- a/src/core/busname.c
+++ b/src/core/busname.c
@@ -585,6 +585,12 @@ static void busname_enter_running(BusName *n) {
}
if (!pending) {
+ if (!UNIT_ISSET(n->service)) {
+ log_unit_error(UNIT(n), "Service to activate vanished, refusing activation.");
+ r = -ENOENT;
+ goto fail;
+ }
+
r = manager_add_job(UNIT(n)->manager, JOB_START, UNIT_DEREF(n->service), JOB_REPLACE, true, &error, NULL);
if (r < 0)
goto fail;