package initsystem
import "k8s.io/kubernetes/pkg/util/initsystem"
Index ¶
- type InitSystem
- type OpenRCInitSystem
- func (openrc OpenRCInitSystem) EnableCommand(service string) string
- func (openrc OpenRCInitSystem) ServiceExists(service string) bool
- func (openrc OpenRCInitSystem) ServiceIsActive(service string) bool
- func (openrc OpenRCInitSystem) ServiceIsEnabled(service string) bool
- func (openrc OpenRCInitSystem) ServiceRestart(service string) error
- func (openrc OpenRCInitSystem) ServiceStart(service string) error
- func (openrc OpenRCInitSystem) ServiceStop(service string) error
- type SystemdInitSystem
- func (sysd SystemdInitSystem) EnableCommand(service string) string
- func (sysd SystemdInitSystem) ServiceExists(service string) bool
- func (sysd SystemdInitSystem) ServiceIsActive(service string) bool
- func (sysd SystemdInitSystem) ServiceIsEnabled(service string) bool
- func (sysd SystemdInitSystem) ServiceRestart(service string) error
- func (sysd SystemdInitSystem) ServiceStart(service string) error
- func (sysd SystemdInitSystem) ServiceStop(service string) error
- type WindowsInitSystem
- func (sysd WindowsInitSystem) EnableCommand(service string) string
- func (sysd WindowsInitSystem) ServiceExists(service string) bool
- func (sysd WindowsInitSystem) ServiceIsActive(service string) bool
- func (sysd WindowsInitSystem) ServiceIsEnabled(service string) bool
- func (sysd WindowsInitSystem) ServiceRestart(service string) error
- func (sysd WindowsInitSystem) ServiceStart(service string) error
- func (sysd WindowsInitSystem) ServiceStop(service string) error
Types ¶
type InitSystem ¶
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 }
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 OpenRCInitSystem ¶
type OpenRCInitSystem struct{}
func (OpenRCInitSystem) EnableCommand ¶
func (openrc OpenRCInitSystem) EnableCommand(service string) string
func (OpenRCInitSystem) ServiceExists ¶
func (openrc OpenRCInitSystem) ServiceExists(service string) bool
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 ¶
func (openrc OpenRCInitSystem) ServiceIsActive(service string) bool
func (OpenRCInitSystem) ServiceIsEnabled ¶
func (openrc OpenRCInitSystem) ServiceIsEnabled(service string) bool
func (OpenRCInitSystem) ServiceRestart ¶
func (openrc OpenRCInitSystem) ServiceRestart(service string) error
func (OpenRCInitSystem) ServiceStart ¶
func (openrc OpenRCInitSystem) ServiceStart(service string) error
func (OpenRCInitSystem) ServiceStop ¶
func (openrc OpenRCInitSystem) ServiceStop(service string) error
type SystemdInitSystem ¶
type SystemdInitSystem struct{}
func (SystemdInitSystem) EnableCommand ¶
func (sysd SystemdInitSystem) EnableCommand(service string) string
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) ServiceRestart ¶
func (sysd SystemdInitSystem) ServiceRestart(service string) error
func (SystemdInitSystem) ServiceStart ¶
func (sysd SystemdInitSystem) ServiceStart(service string) error
func (SystemdInitSystem) ServiceStop ¶
func (sysd SystemdInitSystem) ServiceStop(service string) error
type WindowsInitSystem ¶
type WindowsInitSystem struct{}
WindowsInitSystem is the windows implementation of InitSystem
func (WindowsInitSystem) EnableCommand ¶
func (sysd WindowsInitSystem) EnableCommand(service string) string
func (WindowsInitSystem) ServiceExists ¶
func (sysd WindowsInitSystem) ServiceExists(service string) bool
func (WindowsInitSystem) ServiceIsActive ¶
func (sysd WindowsInitSystem) ServiceIsActive(service string) bool
func (WindowsInitSystem) ServiceIsEnabled ¶
func (sysd WindowsInitSystem) ServiceIsEnabled(service string) bool
func (WindowsInitSystem) ServiceRestart ¶
func (sysd WindowsInitSystem) ServiceRestart(service string) error
func (WindowsInitSystem) ServiceStart ¶
func (sysd WindowsInitSystem) ServiceStart(service string) error
func (WindowsInitSystem) ServiceStop ¶
func (sysd WindowsInitSystem) ServiceStop(service string) error
Source Files ¶
initsystem.go
- Version
- v1.15.0-beta.1
- Published
- May 28, 2019
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 21 minutes ago –
Tools for package owners.