MCPcopy Create free account
hub / github.com/containerd/cgroups / getSystemdFullPath

Function getSystemdFullPath

cgroup2/manager.go:922–924  ·  view source on GitHub ↗

getSystemdFullPath returns the full systemd path when creating a systemd slice group. the reason this is necessary is because the "-" character has a special meaning in systemd slice. For example, when creating a slice called "my-group-112233.slice", systemd will create a hierarchy like this: /sys

(slice, group string)

Source from the content-addressed store, hash-verified

920//
921// /sys/fs/cgroup/my.slice/my-group.slice/my-group-112233.slice
922func getSystemdFullPath(slice, group string) string {
923 return filepath.Join(defaultCgroup2Path, dashesToPath(slice), dashesToPath(group))
924}
925
926// dashesToPath converts a slice name with dashes to it's corresponding systemd filesystem path.
927func dashesToPath(in string) string {

Callers 3

TestSystemdFullPathFunction · 0.85
NewSystemdFunction · 0.85
LoadSystemdFunction · 0.85

Calls 1

dashesToPathFunction · 0.85

Tested by 1

TestSystemdFullPathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…