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(svc string) error
- func (s *OpenRC) Enable(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) Name() string
- func (s *OpenRC) Restart(svc string) error
- func (s *OpenRC) Start(svc string) error
- func (s *OpenRC) Stop(svc string) error
- type Runner
- type Systemd
- func (s *Systemd) Active(svc string) bool
- func (s *Systemd) Disable(svc string) error
- func (s *Systemd) Enable(svc string) error
- func (s *Systemd) ForceStop(svc string) error
- func (s *Systemd) GenerateInitShim(svc string, binary string, unit string) ([]assets.CopyableFile, error)
- func (s *Systemd) Name() string
- func (s *Systemd) Restart(svc string) error
- func (s *Systemd) Start(svc string) error
- func (s *Systemd) Stop(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 // Enable enables a service Enable(string) error // Start starts a service idempotently Start(string) error // Restart restarts a service Restart(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) 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) GenerateInitShim ¶
func (s *Systemd) GenerateInitShim(svc string, binary string, unit string) ([]assets.CopyableFile, error)
GenerateInitShim does nothing for systemd
Click to show internal directories.
Click to hide internal directories.