Documentation ¶
Overview ¶
Package sysinit provides an abstraction over init systems like systemctl
Package sysinit provides an abstraction over init systems like systemctl
Index ¶
- type Manager
- type OpenRC
- func (s *OpenRC) Active(svc string) bool
- func (s *OpenRC) Disable(_ string) error
- func (s *OpenRC) DisableNow(svc string) error
- func (s *OpenRC) Enable(_ string) error
- func (s *OpenRC) EnableNow(svc string) error
- func (s *OpenRC) ForceStop(svc string) error
- func (s *OpenRC) GenerateInitShim(svc string, binary string, unit string) ([]assets.CopyableFile, error)
- func (s *OpenRC) Mask(_ string) error
- func (s *OpenRC) Name() string
- func (s *OpenRC) Reload(_ string) error
- func (s *OpenRC) Restart(svc string) error
- func (s *OpenRC) Start(svc string) error
- func (s *OpenRC) Stop(svc string) error
- func (s *OpenRC) Unmask(_ string) error
- type Runner
- type Systemd
- func (s *Systemd) Active(svc string) bool
- func (s *Systemd) Disable(svc string) error
- func (s *Systemd) DisableNow(svc string) error
- func (s *Systemd) Enable(svc string) error
- func (s *Systemd) EnableNow(svc string) error
- func (s *Systemd) ForceStop(svc string) error
- func (s *Systemd) GenerateInitShim(_, _, _ string) ([]assets.CopyableFile, error)
- func (s *Systemd) Mask(svc string) error
- func (s *Systemd) Name() string
- func (s *Systemd) Reload(svc string) error
- func (s *Systemd) Restart(svc string) error
- func (s *Systemd) Start(svc string) error
- func (s *Systemd) Stop(svc string) error
- func (s *Systemd) Unmask(svc string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // Name returns the name of the init manager Name() string // Active returns if a service is active Active(string) bool // Disable disables a service Disable(string) error // Disable disables a service and stops it right after. DisableNow(string) error // Mask prevents a service from being started Mask(string) error // Enable enables a service Enable(string) error // EnableNow enables a service and starts it right after. EnableNow(string) error // Unmask allows a service to be started Unmask(string) error // Start starts a service idempotently Start(string) error // Restart restarts a service Restart(string) error // Reload restarts a service Reload(string) error // Stop stops a service Stop(string) error // ForceStop stops a service with prejudice ForceStop(string) error // GenerateInitShim generates any additional init files required for this service GenerateInitShim(svc string, binary string, unit string) ([]assets.CopyableFile, error) }
Manager is a common interface for init systems
type OpenRC ¶
type OpenRC struct {
// contains filtered or unexported fields
}
OpenRC is a service manager for OpenRC-like init systems
func (*OpenRC) DisableNow ¶ added in v1.18.0
DisableNow does Disable + Stop
func (*OpenRC) GenerateInitShim ¶
func (s *OpenRC) GenerateInitShim(svc string, binary string, unit string) ([]assets.CopyableFile, error)
GenerateInitShim generates any additional init files required for this service
type Systemd ¶
type Systemd struct {
// contains filtered or unexported fields
}
Systemd is a service manager for systemd distributions
func (*Systemd) DisableNow ¶ added in v1.18.0
DisableNow disables a service and stops it too (not waiting for next restart)
func (*Systemd) EnableNow ¶ added in v1.18.0
EnableNow enables a service and then activates it too (not waiting for next start)
func (*Systemd) GenerateInitShim ¶
func (s *Systemd) GenerateInitShim(_, _, _ string) ([]assets.CopyableFile, error)
GenerateInitShim does nothing for systemd
Click to show internal directories.
Click to hide internal directories.