chiark / gitweb /
cgroup: add cgroupsification
[elogind.git] / socket.c
index aec0d392a683e531f674514b8a904e55d2b524e2..79933347d0e02d296e8858d2e421360bf89f4f3e 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -129,6 +129,10 @@ static int socket_init(Unit *u) {
         if ((r = unit_add_dependency(u, UNIT_BEFORE, UNIT(s->service))) < 0)
                 goto fail;
 
+        /* Add default cgroup */
+        if ((r = unit_add_default_cgroup(u)) < 0)
+                goto fail;
+
         return 0;
 
 fail:
@@ -394,7 +398,13 @@ static int socket_spawn(Socket *s, ExecCommand *c, bool timeout, pid_t *_pid) {
         } else
                 unit_unwatch_timer(UNIT(s), &s->timer_watch);
 
-        if ((r = exec_spawn(c, &s->exec_context, NULL, 0, true, true, &pid)) < 0)
+        if ((r = exec_spawn(c,
+                            &s->exec_context,
+                            NULL, 0,
+                            true,
+                            true,
+                            UNIT(s)->meta.cgroup_bondings,
+                            &pid)) < 0)
                 goto fail;
 
         if ((r = unit_watch_pid(UNIT(s), pid)) < 0)