summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-05-03 14:46:29 +0200
committerLennart Poettering <lennart@poettering.net>2012-05-03 14:46:29 +0200
commit0b86feac50be53f278fa4f47024335cc8c20cc24 (patch)
treedfe32411842708b1a603da27dad21c13bb22f9e9 /src/core/service.c
parent7e2668c6fd5720ae4d2d55eb8a062739687516af (diff)
service: default to Type=dbus if BusName= is specified
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/service.c b/src/core/service.c
index a99e1c3770..02d1aa845b 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -115,6 +115,7 @@ static void service_init(Unit *u) {
s->timeout_usec = DEFAULT_TIMEOUT_USEC;
s->restart_usec = DEFAULT_RESTART_USEC;
+ s->type = _SERVICE_TYPE_INVALID;
s->watchdog_watch.type = WATCH_INVALID;
@@ -1216,6 +1217,9 @@ static int service_load(Unit *u) {
/* This is a new unit? Then let's add in some extras */
if (u->load_state == UNIT_LOADED) {
+ if (s->type == _SERVICE_TYPE_INVALID)
+ s->type = s->bus_name ? SERVICE_DBUS : SERVICE_SIMPLE;
+
service_fix_output(s);
if ((r = unit_add_exec_dependencies(u, &s->exec_context)) < 0)