kubernetes/vendor/github.com/opencontainers/runc/libcontainer/cgroups/systemd/common.go

const defCPUQuotaPeriod

var versionOnce

var version

var isRunningSystemdOnce

var isRunningSystemd

var GenerateDeviceProps

// 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 IsRunningSystemd() bool {}

// 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 ExpandSlice(slice string) (string, error) {}

func newProp(name string, units interface{}

func getUnitName(c *configs.Cgroup) string {}

// This code should be in sync with getUnitName.
func getUnitType(unitName string) string {}

// isDbusError returns true if the error is a specific dbus error.
func isDbusError(err error, name string) bool {}

// isUnitExists returns true if the error is that a systemd unit already exists.
func isUnitExists(err error) bool {}

func startUnit(cm *dbusConnManager, unitName string, properties []systemdDbus.Property, ignoreExist bool) error {}

func stopUnit(cm *dbusConnManager, unitName string) error {}

func resetFailedUnit(cm *dbusConnManager, name string) error {}

func getUnitTypeProperty(cm *dbusConnManager, unitName string, unitType string, propertyName string) (*systemdDbus.Property, error) {}

func setUnitProperties(cm *dbusConnManager, name string, properties ...systemdDbus.Property) error {}

func getManagerProperty(cm *dbusConnManager, name string) (string, error) {}

func systemdVersion(cm *dbusConnManager) int {}

// systemdVersionAtoi extracts a numeric systemd version from the argument.
// The argument should be of the form: "v245.4-1.fc32", "245", "v245-1.fc32",
// "245-1.fc32" (with or without quotes). The result for all of the above
// should be 245.
func systemdVersionAtoi(str string) (int, error) {}

func addCpuQuota(cm *dbusConnManager, properties *[]systemdDbus.Property, quota int64, period uint64) {}

func addCpuset(cm *dbusConnManager, props *[]systemdDbus.Property, cpus, mems string) error {}

// generateDeviceProperties takes the configured device rules and generates a
// corresponding set of systemd properties to configure the devices correctly.
func generateDeviceProperties(r *configs.Resources, cm *dbusConnManager) ([]systemdDbus.Property, error) {}