summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-10-21 16:22:15 +0200
committerGitHub <noreply@github.com>2016-10-21 16:22:15 +0200
commit5138a901b1d27be9c6a6e73b8e139aa7125f2bb0 (patch)
treedb4a65c4846d4f1992a48eb1602ebeea6bb39983
parent6fa441140ee6faf131c97b1aa002e060b81aaaff (diff)
parent47fffb3530af3e3ad4048570611685635fde062e (diff)
Merge pull request #4447 from poettering/oneshotassertfix
core: if the start command vanishes during runtime don't hit an assert
-rw-r--r--src/core/service.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/service.c b/src/core/service.c
index f9127d7509..53c26984ca 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1756,7 +1756,15 @@ static void service_enter_start(Service *s) {
}
if (!c) {
- assert(s->type == SERVICE_ONESHOT);
+ if (s->type != SERVICE_ONESHOT) {
+ /* There's no command line configured for the main command? Hmm, that is strange. This can only
+ * happen if the configuration changes at runtime. In this case, let's enter a failure
+ * state. */
+ log_unit_error(UNIT(s), "There's no 'start' task anymore we could start: %m");
+ r = -ENXIO;
+ goto fail;
+ }
+
service_enter_start_post(s);
return;
}