v1

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CgroupControllerRWFiles

func CgroupControllerRWFiles(isolator string) []string

func CreateCgroups

func CreateCgroups(root string, enabledCgroups map[int][]string, mountContext string) error

CreateCgroups mounts the v1 cgroup controllers hierarchy in /sys/fs/cgroup under root

func GetCgroupPathByPid

func GetCgroupPathByPid(pid int, controller string) (string, error)

GetCgroupPathByPid returns the cgroup path of the process with the given pid and given controller.

func GetControllerDirs

func GetControllerDirs(cgroups map[int][]string) []string

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

func GetEnabledCgroups() (map[int][]string, error)

GetEnabledCgroups returns a map with the enabled cgroup controllers grouped by hierarchy

func GetOwnCgroupPath

func GetOwnCgroupPath(controller string) (string, error)

GetOwnCgroupPath returns the cgroup path of this process in controller hierarchy

func IsControllerMounted

func IsControllerMounted(c string) bool

IsControllerMounted returns whether a controller is mounted by checking that cgroup.procs is accessible

func JoinSubcgroup

func JoinSubcgroup(controller string, subcgroup string) error

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 RemountCgroupsRO

func RemountCgroupsRO(root string, enabledCgroups map[int][]string, subcgroup string, serviceNames []string) error

RemountCgroupsRO remounts the v1 cgroup hierarchy under root read-only, leaving the needed knobs in the subcgroup for each app read-write so the systemd inside stage1 can apply isolators to them

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL