]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
service: default to Type=dbus if BusName= is specified
authorLennart Poettering <lennart@poettering.net>
Thu, 3 May 2012 12:46:29 +0000 (14:46 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 3 May 2012 12:46:29 +0000 (14:46 +0200)
man/systemd.service.xml
src/core/service.c

index 1551d0d0ae0069f8a7ec6d98c253c3248d47ea8c..11f98c34d6537b5ae08277fb7805f37ae48b909e 100644 (file)
 
                                 <para>If set to
                                 <option>simple</option> (the default
-                                value) it is expected that the process
-                                configured with
+                                value if <varname>BusName=</varname>
+                                is not specified) it is expected that
+                                the process configured with
                                 <varname>ExecStart=</varname> is the
                                 main process of the service. In this
                                 mode, if the process offers
                                 option configured implicitly gain
                                 dependencies on the
                                 <filename>dbus.socket</filename>
-                                unit.</para>
+                                unit. This type is the default if
+                                <varname>BusName=</varname> is
+                                specified.</para>
 
                                 <para>Behaviour of
                                 <option>notify</option> is similar to
index a99e1c3770f6212e363ca1c1a5d9251f4d789324..02d1aa845b4f2663a9397713c47f4eb71f4c4a35 100644 (file)
@@ -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)