You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The systemd cgroup path convention currently implemented in runtimes
like `runc/crun` should be added to the spec. For more information,
please kindly refer to e.g. runc systemd cgroup driver doc:
https://github.com/opencontainers/runc/blame/main/docs/systemd.md.
This patch adds the systemd cgroup convention for `Linux.CgroupsPath`
which is in the `slice:prefix:name` form and clarifies the detailed
usage.
Fixes#1021
Signed-off-by: Kailun Qin <[email protected]>
Copy file name to clipboardExpand all lines: config-linux.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,11 +186,30 @@ containers.
186
186
**`cgroupsPath`** (string, OPTIONAL) path to the cgroups.
187
187
It can be used to either control the cgroups hierarchy for containers or to run a new process in an existing container.
188
188
189
-
The value of `cgroupsPath` MUST be either an absolute path or a relative path.
189
+
If the runtime manages cgroups on its own (i.e. works with cgroupfs directly), the value of `cgroupsPath` MUST be either an absolute path or a relative path.
190
190
191
191
* In the case of an absolute path (starting with `/`), the runtime MUST take the path to be relative to the cgroups mount point.
192
192
* In the case of a relative path (not starting with `/`), the runtime MAY interpret the path relative to a runtime-determined location in the cgroups hierarchy.
193
193
194
+
If the runtime manages cgroups indirectly, via systemd, the value of `cgroupsPath` MUST be in the "slice:prefix:name" form (e.g. "system.slice:runtime:434234").
195
+
By specifying with the transient systemd unit to create for the container and the containing slice which hosts the unit, the systemd units directly map to objects in the cgroup tree.
196
+
When these units are activated, they map directly to cgroup paths built from the unit names.
197
+
198
+
This form specifies the following systemd cgroup properties which are all optional:
199
+
200
+
*`slice` - name of the parent slice systemd unit, under which the container is placed.
201
+
Note that `slice` can contain dashes to denote a sub-slice (e.g. `user-1000.slice` is a correct
202
+
notation, meaning a subslice of `user.slice`), but it must not contain slashes (e.g.
203
+
`user.slice/user-1000.slice` is invalid). A `slice` of `-` represents a root slice.
204
+
If not specified, it can default to:
205
+
`system.slice` - the default place for all system services;
206
+
`user.slice` - the default place for all user sessions, used for cgroup v2 and rootless containers.
207
+
*`prefix` - prefix of the scope systemd unit to create for the container.
208
+
*`name` - name of the systemd unit to create.
209
+
When `name` has `.slice` suffix, in which case `prefix` is ignored and the `name` is used as is,
210
+
this describes a unit being created is a slice. Otherwise, `prefix` and `name` are used to
211
+
compose the scope unit name, which is `<prefix>-<name>.scope`.
212
+
194
213
If the value is specified, the runtime MUST consistently attach to the same place in the cgroups hierarchy given the same value of `cgroupsPath`.
195
214
If the value is not specified, the runtime MAY define the default cgroups path.
196
215
Runtimes MAY consider certain `cgroupsPath` values to be invalid, and MUST generate an error if this is the case.
0 commit comments