service: don't add After= dependencies on .busname units if kdbus support is disabled
This commit is contained in:
parent
6421348d52
commit
6962fd3bd2
|
@ -555,16 +555,18 @@ static int service_add_extras(Service *s) {
|
|||
s->notify_access = NOTIFY_MAIN;
|
||||
|
||||
if (s->bus_name) {
|
||||
#ifdef ENABLE_KDBUS
|
||||
const char *n;
|
||||
|
||||
r = unit_watch_bus_name(UNIT(s), s->bus_name);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
n = strjoina(s->bus_name, ".busname");
|
||||
r = unit_add_dependency_by_name(UNIT(s), UNIT_AFTER, n, NULL, true);
|
||||
if (r < 0)
|
||||
return r;
|
||||
#endif
|
||||
|
||||
r = unit_watch_bus_name(UNIT(s), s->bus_name);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (UNIT(s)->default_dependencies) {
|
||||
|
|
Loading…
Reference in a new issue