package v1

import "github.com/coreos/rkt/common/cgroup/v1"

Index

Functions

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

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, error)

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 RemountCgroups

func RemountCgroups(m fs.Mounter, root string, enabledCgroups map[int][]string, subcgroup 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 pod's subcgroup read-write, such that systemd inside stage1 can apply isolators to them. It leaves /sys read-write if the given readWrite parameter is true. When this is done, <stage1>/sys/fs/cgroup/<controller> should be RO, and <stage1>/sys/fs/cgroup/<cotroller>/.../machine-rkt/.../system.slice should be RW

Source Files

cgroup.go

Version
v1.30.0 (latest)
Published
Apr 13, 2018
Platform
linux/amd64
Imports
12 packages
Last checked
7 hours ago

Tools for package owners.