package initsystem
import "k8s.io/kubernetes/cmd/kubeadm/app/util/initsystem"
Index ¶
- type InitSystem
- 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 { // EnableCommand returns 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 ¶
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 WindowsInitSystem ¶
type WindowsInitSystem struct{}
WindowsInitSystem is the windows implementation of InitSystem
func (WindowsInitSystem) EnableCommand ¶
func (sysd WindowsInitSystem) EnableCommand(service string) string
EnableCommand return a string describing how to enable a service
func (WindowsInitSystem) ServiceExists ¶
func (sysd WindowsInitSystem) ServiceExists(service string) bool
ServiceExists ensures the service is defined for this init system.
func (WindowsInitSystem) ServiceIsActive ¶
func (sysd WindowsInitSystem) ServiceIsActive(service string) bool
ServiceIsActive ensures the service is running, or attempting to run. (crash looping in the case of kubelet)
func (WindowsInitSystem) ServiceIsEnabled ¶
func (sysd WindowsInitSystem) ServiceIsEnabled(service string) bool
ServiceIsEnabled ensures the service is enabled to start on each boot.
func (WindowsInitSystem) ServiceRestart ¶
func (sysd WindowsInitSystem) ServiceRestart(service string) error
ServiceRestart tries to reload the environment and restart the specific service
func (WindowsInitSystem) ServiceStart ¶
func (sysd WindowsInitSystem) ServiceStart(service string) error
ServiceStart tries to start a specific service Following Windows documentation: https://docs.microsoft.com/en-us/windows/desktop/Services/starting-a-service
func (WindowsInitSystem) ServiceStop ¶
func (sysd WindowsInitSystem) ServiceStop(service string) error
ServiceStop tries to stop a specific service Following Windows documentation: https://docs.microsoft.com/en-us/windows/desktop/Services/stopping-a-service
Source Files ¶
initsystem.go initsystem_windows.go
- Version
- v1.29.6
- Published
- Jun 11, 2024
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 2 hours ago –
Tools for package owners.