]> git.ipfire.org Git - people/ms/systemd.git/blobdiff - service.c
cgroup: if we are already in our own cgroup, then reuse it
[people/ms/systemd.git] / service.c
index bd248a07881c387f01c93365a2384239965d4f96..f334027a7986b094f8bc38f6f01337fcaa410b7b 100644 (file)
--- a/service.c
+++ b/service.c
@@ -31,6 +31,7 @@
 #include "log.h"
 #include "strv.h"
 #include "unit-name.h"
+#include "dbus-service.h"
 
 #define COMMENTS "#;\n"
 #define NEWLINES "\n\r"
@@ -740,30 +741,13 @@ static void service_init(Unit *u) {
         assert(u);
         assert(u->meta.load_state == UNIT_STUB);
 
-        s->type = 0;
-        s->restart = 0;
-
         s->timeout_usec = DEFAULT_TIMEOUT_USEC;
         s->restart_usec = DEFAULT_RESTART_USEC;
-
-        exec_context_init(&s->exec_context);
-
         s->timer_watch.type = WATCH_INVALID;
-
-        s->state = SERVICE_DEAD;
-
         s->sysv_start_priority = -1;
-        s->permissions_start_only = false;
-        s->root_directory_start_only = false;
-        s->valid_no_process = false;
-        s->kill_mode = 0;
-        s->sysv_has_lsb = false;
-        s->main_pid = s->control_pid = 0;
-        s->main_pid_known = false;
-        s->failure = false;
-
         s->socket_fd = -1;
-        s->bus_name_good = false;
+
+        exec_context_init(&s->exec_context);
 
         RATELIMIT_INIT(s->ratelimit, 10*USEC_PER_SEC, 5);
 }
@@ -987,7 +971,8 @@ static int service_get_sockets(Service *s, Set **_set) {
                 p = manager_get_unit(UNIT(s)->meta.manager, k);
                 free(k);
 
-                if (!p) continue;
+                if (!p)
+                        continue;
 
                 if ((r = set_put(set, p)) < 0)
                         goto fail;
@@ -2255,5 +2240,7 @@ const UnitVTable service_vtable = {
         .bus_name_owner_change = service_bus_name_owner_change,
         .bus_query_pid_done = service_bus_query_pid_done,
 
+        .bus_message_handler = bus_service_message_handler,
+
         .enumerate = service_enumerate
 };