From 61781c72fedc6cad626aecfda75bc009af6254b6 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 9 Apr 2021 18:11:34 +0200 Subject: [PATCH] cgroup: Call ifupdown in system cgroup Signed-off-by: Joachim Wiberg --- README.md | 4 ++-- doc/config.md | 5 ++--- src/helpers.c | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 65c7b5c2..685e7995 100644 --- a/README.md +++ b/README.md @@ -254,8 +254,8 @@ in which services and user sessions are placed in: |-- system/ # cpu.weight:9800 `-- user/ # cpu.weight:100 -Finit itself, helper services like `ifup -a`, and the like are placed -in the leaf-node group `init/`, which also is _reserved_. +Finit itself and its helper scripts and services are placed in the +top-level leaf-node group `init/`, which also is _reserved_. All run/task/service/sysv processes are placed in their own sub-group in `system/`. The name of each sub-group is taken from the respective diff --git a/doc/config.md b/doc/config.md index 6c42cb8b..bcf79bf3 100644 --- a/doc/config.md +++ b/doc/config.md @@ -160,9 +160,8 @@ the above three. We leave `init/` and `user /` as-is reducing weight of cgroup maint cpu.weight:100 By default, the `system/` cgroup is selected for almost everything. The -`init/` cgroup is reserved for PID 1 itself and its closest relatives, -e.g., children of `ifup -a`. The `user/` cgroup is for local TTY logins -spawned by getty. +`init/` cgroup is reserved for PID 1 itself and its closest relatives. +The `user/` cgroup is for local TTY logins spawned by getty. To select a different top-level cgroup, e.g. `maint/`, one can either define it for a group of run/task/service directives in a `.conf` or per diff --git a/src/helpers.c b/src/helpers.c index 4003556b..17b8cb18 100644 --- a/src/helpers.c +++ b/src/helpers.c @@ -537,6 +537,7 @@ void networking(int updown) run("ifdown -a"); _exit(0); } + cgroup_service("network", pid, NULL); print(pid > 0 ? 0 : 1, "%s networking", updown ? "Starting" : "Stopping"); }