From: Lennart Poettering Date: Thu, 3 May 2012 12:46:29 +0000 (+0200) Subject: service: default to Type=dbus if BusName= is specified X-Git-Tag: v183~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0b86feac50be53f278fa4f47024335cc8c20cc24;p=platform%2Fupstream%2Fsystemd.git service: default to Type=dbus if BusName= is specified --- diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 1551d0d..11f98c3 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -126,8 +126,9 @@ If set to (the default - value) it is expected that the process - configured with + value if BusName= + is not specified) it is expected that + the process configured with ExecStart= is the main process of the service. In this mode, if the process offers @@ -182,7 +183,9 @@ option configured implicitly gain dependencies on the dbus.socket - unit. + unit. This type is the default if + BusName= is + specified. Behaviour of is similar to diff --git a/src/core/service.c b/src/core/service.c index a99e1c3..02d1aa8 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)