initsystem

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 4 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 {
	// ServiceIsEnabled ensures the service is enabled to start on each boot.
	ServiceIsEnabled(service string) bool

	// ServiceEnable tries to enable a specific service
	ServiceEnable(service string) error

	// 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

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

type OpenRCInitSystem struct{}

OpenRCInitSystem defines openrc

func (OpenRCInitSystem) ServiceEnable added in v1.4.0

func (openrc OpenRCInitSystem) ServiceEnable(service string) error

ServiceEnable tries to start a specific service

func (OpenRCInitSystem) ServiceIsActive

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 added in v1.4.0

func (openrc OpenRCInitSystem) ServiceIsEnabled(service string) bool

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

type SystemdInitSystem

type SystemdInitSystem struct{}

SystemdInitSystem defines systemd

func (SystemdInitSystem) ServiceEnable added in v1.4.0

func (sysd SystemdInitSystem) ServiceEnable(service string) error

ServiceEnable tries to start a specific service

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 added in v1.4.0

func (sysd SystemdInitSystem) ServiceIsEnabled(service string) bool

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

Jump to

Keyboard shortcuts

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