package systemd
import "github.com/opencontainers/runc/libcontainer/cgroups/systemd"
Index ¶
- func ExpandSlice(slice string) (string, error)
- func Freeze(c *configs.Cgroup, state configs.FreezerState) error
- func IsRunningSystemd() bool
- func NewSystemdCgroupsManager() (func(config *configs.Cgroup, paths map[string]string) cgroups.Manager, error)
- func RangeToBits(str string) ([]byte, error)
- type Manager
- func (m *Manager) Apply(pid int) error
- func (m *Manager) Destroy() error
- func (m *Manager) Exists() bool
- func (m *Manager) Freeze(state configs.FreezerState) error
- func (m *Manager) GetAllPids() ([]int, error)
- func (m *Manager) GetCgroups() (*configs.Cgroup, error)
- func (m *Manager) GetPaths() map[string]string
- func (m *Manager) GetPids() ([]int, error)
- func (m *Manager) GetStats() (*cgroups.Stats, error)
- func (m *Manager) Path(_ string) string
- func (m *Manager) Set(container *configs.Config) error
Functions ¶
func ExpandSlice ¶
systemd represents slice hierarchy using `-`, so we need to follow suit when generating the path of slice. Essentially, test-a-b.slice becomes /test.slice/test-a.slice/test-a-b.slice.
func Freeze ¶
func Freeze(c *configs.Cgroup, state configs.FreezerState) error
func IsRunningSystemd ¶
func IsRunningSystemd() bool
NOTE: This function comes from package github.com/coreos/go-systemd/util It was borrowed here to avoid a dependency on cgo.
IsRunningSystemd checks whether the host was booted with systemd as its init system. This functions similarly to systemd's `sd_booted(3)`: internally, it checks whether /run/systemd/system/ exists and is a directory. http://www.freedesktop.org/software/systemd/man/sd_booted.html
func NewSystemdCgroupsManager ¶
func NewSystemdCgroupsManager() (func(config *configs.Cgroup, paths map[string]string) cgroups.Manager, error)
func RangeToBits ¶
RangeToBits converts a text representation of a CPU mask (as written to or read from cgroups' cpuset.* files, e.g. "1,3-5") to a slice of bytes with the corresponding bits set (as consumed by systemd over dbus as AllowedCPUs/AllowedMemoryNodes unit property value).
Types ¶
type Manager ¶
func (*Manager) Apply ¶
func (*Manager) Destroy ¶
func (*Manager) Exists ¶
func (*Manager) Freeze ¶
func (m *Manager) Freeze(state configs.FreezerState) error
func (*Manager) GetAllPids ¶
func (*Manager) GetCgroups ¶
func (*Manager) GetPaths ¶
func (*Manager) GetPids ¶
func (*Manager) GetStats ¶
func (*Manager) Path ¶
func (*Manager) Set ¶
Source Files ¶
common.go cpuset.go unsupported.go
- Version
- v1.0.0
- Published
- Jun 17, 2021
- Platform
- js/wasm
- Imports
- 21 packages
- Last checked
- 3 hours ago –
Tools for package owners.