803fb7
From 7c1b21bad54714f04d0d2a8c77008408affe7067 Mon Sep 17 00:00:00 2001
803fb7
From: Michael Biebl <biebl@debian.org>
803fb7
Date: Sat, 14 Mar 2015 16:48:54 +0100
803fb7
Subject: [PATCH] service: don't add After= dependencies on .busname units if
803fb7
 kdbus support is disabled
803fb7
803fb7
(cherry picked from commit 6962fd3bd28cb5d3aaff69c1e3b6cc006e7c8426)
803fb7
---
803fb7
 src/core/service.c | 8 +++++---
803fb7
 1 file changed, 5 insertions(+), 3 deletions(-)
803fb7
803fb7
diff --git a/src/core/service.c b/src/core/service.c
803fb7
index 7781b4e62..ae5e61000 100644
803fb7
--- a/src/core/service.c
803fb7
+++ b/src/core/service.c
803fb7
@@ -556,14 +556,16 @@ static int service_add_extras(Service *s) {
803fb7
                 s->notify_access = NOTIFY_MAIN;
803fb7
 
803fb7
         if (s->bus_name) {
803fb7
+#ifdef ENABLE_KDBUS
803fb7
                 const char *n;
803fb7
 
803fb7
-                r = unit_watch_bus_name(UNIT(s), s->bus_name);
803fb7
+                n = strjoina(s->bus_name, ".busname");
803fb7
+                r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
803fb7
                 if (r < 0)
803fb7
                         return r;
803fb7
+#endif
803fb7
 
803fb7
-                n = strjoina(s->bus_name, ".busname");
803fb7
-                r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
803fb7
+                r = unit_watch_bus_name(UNIT(s), s->bus_name);
803fb7
                 if (r < 0)
803fb7
                         return r;
803fb7
         }