initsystem

package
v1.9.4-beta.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitSystem

type InitSystem interface {
	// ServiceStart tries to start a specific service
	ServiceStart(service string) error

	// ServiceStop tries to stop a specific service
	ServiceStop(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
}

func GetInitSystem

func GetInitSystem() (InitSystem, error)

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

type SystemdInitSystem

type SystemdInitSystem struct{}

func (SystemdInitSystem) ServiceExists

func (sysd SystemdInitSystem) ServiceExists(service string) bool

func (SystemdInitSystem) ServiceIsActive

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

func (sysd SystemdInitSystem) ServiceIsEnabled(service string) bool

func (SystemdInitSystem) ServiceStart

func (sysd SystemdInitSystem) ServiceStart(service string) error

func (SystemdInitSystem) ServiceStop

func (sysd SystemdInitSystem) ServiceStop(service string) error

type WindowsInitSystem added in v1.9.0

type WindowsInitSystem struct{}

WindowsInitSystem is the windows implementation of InitSystem

func (WindowsInitSystem) ServiceExists added in v1.9.0

func (sysd WindowsInitSystem) ServiceExists(service string) bool

func (WindowsInitSystem) ServiceIsActive added in v1.9.0

func (sysd WindowsInitSystem) ServiceIsActive(service string) bool

func (WindowsInitSystem) ServiceIsEnabled added in v1.9.0

func (sysd WindowsInitSystem) ServiceIsEnabled(service string) bool

func (WindowsInitSystem) ServiceStart added in v1.9.0

func (sysd WindowsInitSystem) ServiceStart(service string) error

func (WindowsInitSystem) ServiceStop added in v1.9.0

func (sysd WindowsInitSystem) ServiceStop(service string) error

Jump to

Keyboard shortcuts

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