mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00:00
cgroup: ensure all services in init group remain as leaf nodes
The top-level cgroup init is a leaf group and should be treated as such, even for user setup tasks/services. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
d2c57447f0
commit
c047e37a79
1 file changed
+3
@@ -172,6 +172,9 @@ int cgroup_service(char *name, int pid, struct cgroup *cg)
|
|||||||
if (!strcmp(cg->name, "root"))
|
if (!strcmp(cg->name, "root"))
|
||||||
return fnwrite(str("%d", pid), FINIT_CGPATH "/cgroup.procs");
|
return fnwrite(str("%d", pid), FINIT_CGPATH "/cgroup.procs");
|
||||||
|
|
||||||
|
if (!strcmp(cg->name, "init"))
|
||||||
|
return fnwrite(str("%d", pid), FINIT_CGPATH "/init/cgroup.procs");
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "/sys/fs/cgroup/%s", cg->name);
|
snprintf(path, sizeof(path), "/sys/fs/cgroup/%s", cg->name);
|
||||||
if (fisdir(path))
|
if (fisdir(path))
|
||||||
group = cg->name;
|
group = cg->name;
|
||||||
|
|||||||
Reference in new issue
Block a user