kubernetes: k8s.io/kubernetes/cmd/kubeadm/app/util/initsystem Index | Files

package initsystem

import "k8s.io/kubernetes/cmd/kubeadm/app/util/initsystem"

Index

Package Files

initsystem.go initsystem_unix.go

type InitSystem Uses

type InitSystem interface {
    // return a string describing how to enable a service
    EnableCommand(service string) string

    // ServiceStart tries to start a specific service
    ServiceStart(service string) error

    // ServiceStop tries to stop a specific service
    ServiceStop(service string) error

    // ServiceRestart tries to reload the environment and restart the specific service
    ServiceRestart(service string) error

    // ServiceExists ensures the service is defined for this init system.
    ServiceExists(service string) bool

    // ServiceIsEnabled ensures the service is enabled to start on each boot.
    ServiceIsEnabled(service string) bool

    // ServiceIsActive ensures the service is running, or attempting to run. (crash looping in the case of kubelet)
    ServiceIsActive(service string) bool
}

InitSystem is the interface that describe behaviors of an init system

func GetInitSystem Uses

func GetInitSystem() (InitSystem, error)

GetInitSystem returns an InitSystem for the current system, or nil if we cannot detect a supported init system. This indicates we will skip init system checks, not an error.

type OpenRCInitSystem Uses

type OpenRCInitSystem struct{}

OpenRCInitSystem defines openrc

func (OpenRCInitSystem) EnableCommand Uses

func (openrc OpenRCInitSystem) EnableCommand(service string) string

EnableCommand return a string describing how to enable a service

func (OpenRCInitSystem) ServiceExists Uses

func (openrc OpenRCInitSystem) ServiceExists(service string) bool

ServiceExists ensures the service is defined for this init system. openrc writes to stderr if a service is not found or not enabled this is in contrast to systemd which only writes to stdout. Hence, we use the Combinedoutput, and ignore the error.

func (OpenRCInitSystem) ServiceIsActive Uses

func (openrc OpenRCInitSystem) ServiceIsActive(service string) bool

ServiceIsActive ensures the service is running, or attempting to run. (crash looping in the case of kubelet)

func (OpenRCInitSystem) ServiceIsEnabled Uses

func (openrc OpenRCInitSystem) ServiceIsEnabled(service string) bool

ServiceIsEnabled ensures the service is enabled to start on each boot.

func (OpenRCInitSystem) ServiceRestart Uses

func (openrc OpenRCInitSystem) ServiceRestart(service string) error

ServiceRestart tries to reload the environment and restart the specific service

func (OpenRCInitSystem) ServiceStart Uses

func (openrc OpenRCInitSystem) ServiceStart(service string) error

ServiceStart tries to start a specific service

func (OpenRCInitSystem) ServiceStop Uses

func (openrc OpenRCInitSystem) ServiceStop(service string) error

ServiceStop tries to stop a specific service

type SystemdInitSystem Uses

type SystemdInitSystem struct{}

SystemdInitSystem defines systemd

func (SystemdInitSystem) EnableCommand Uses

func (sysd SystemdInitSystem) EnableCommand(service string) string

EnableCommand return a string describing how to enable a service

func (SystemdInitSystem) ServiceExists Uses

func (sysd SystemdInitSystem) ServiceExists(service string) bool

ServiceExists ensures the service is defined for this init system.

func (SystemdInitSystem) ServiceIsActive Uses

func (sysd SystemdInitSystem) ServiceIsActive(service string) bool

ServiceIsActive will check is the service is "active". In the case of crash looping services (kubelet in our case) status will return as "activating", so we will consider this active as well.

func (SystemdInitSystem) ServiceIsEnabled Uses

func (sysd SystemdInitSystem) ServiceIsEnabled(service string) bool

ServiceIsEnabled ensures the service is enabled to start on each boot.

func (SystemdInitSystem) ServiceRestart Uses

func (sysd SystemdInitSystem) ServiceRestart(service string) error

ServiceRestart tries to reload the environment and restart the specific service

func (SystemdInitSystem) ServiceStart Uses

func (sysd SystemdInitSystem) ServiceStart(service string) error

ServiceStart tries to start a specific service

func (SystemdInitSystem) ServiceStop Uses

func (sysd SystemdInitSystem) ServiceStop(service string) error

ServiceStop tries to stop a specific service

Package initsystem imports 3 packages (graph) and is imported by 10 packages. Updated 2019-08-07. Refresh now. Tools for package owners.