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)
| 920 | // |
| 921 | // /sys/fs/cgroup/my.slice/my-group.slice/my-group-112233.slice |
| 922 | func 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. |
| 927 | func dashesToPath(in string) string { |
searching dependent graphs…