Documentation ¶
Index ¶
- func CgroupControllerRWFiles(isolator string) []string
- func CreateCgroups(m fs.Mounter, root string, enabledCgroups map[int][]string, ...) error
- func GetCgroupPathByPid(pid int, controller string) (string, error)
- func GetControllerDirs(cgroups map[int][]string) []string
- func GetEnabledCgroups() (map[int][]string, error)
- func GetOwnCgroupPath(controller string) (string, error)
- func IsControllerMounted(c string) bool
- func JoinSubcgroup(controller string, subcgroup string) error
- func RemountCgroupKnobsRW(enabledCgroups map[int][]string, subcgroup string, serviceName string, ...) error
- func RemountCgroups(m fs.Mounter, root string, enabledCgroups map[int][]string, subcgroup string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CgroupControllerRWFiles ¶
func CreateCgroups ¶
func CreateCgroups(m fs.Mounter, root string, enabledCgroups map[int][]string, mountContext string) error
CreateCgroups mounts the v1 cgroup controllers hierarchy in /sys/fs/cgroup under root
func GetCgroupPathByPid ¶
GetCgroupPathByPid returns the cgroup path of the process with the given pid and given controller.
func GetControllerDirs ¶
GetControllerDirs takes a map with the enabled cgroup controllers grouped by hierarchy and returns the directory names as they should be in /sys/fs/cgroup
func GetEnabledCgroups ¶
GetEnabledCgroups returns a map with the enabled cgroup controllers grouped by hierarchy
func GetOwnCgroupPath ¶
GetOwnCgroupPath returns the cgroup path of this process in controller hierarchy
func IsControllerMounted ¶
IsControllerMounted returns whether a controller is mounted by checking that cgroup.procs is accessible
func JoinSubcgroup ¶
JoinSubcgroup makes the calling process join the subcgroup hierarchy on a particular controller
func RemountCgroupKnobsRW ¶
func RemountCgroupKnobsRW(enabledCgroups map[int][]string, subcgroup string, serviceName string, enterCmd []string) error
RemountCgroupKnobsRW remounts the needed knobs in the subcgroup for one specified app read-write so the systemd inside stage1 can apply isolators to them.
func RemountCgroups ¶ added in v1.21.0
func RemountCgroups(m fs.Mounter, root string, enabledCgroups map[int][]string, subcgroup string, serviceNames []string, readWrite bool) error
RemountCgroups remounts the v1 cgroup hierarchy under root. It mounts /sys/fs/cgroup/[controller] read-only, but leaves needed knobs in the subcgroup for each app read-write, such that systemd inside stage1 can apply isolators to them. It leaves /sys read-write, if the given readWrite parameter is true.
Types ¶
This section is empty.