Documentation
¶
Index ¶
- type ServiceUnit
- type SystemdConfig
- type SystemdPlugin
- func (p *SystemdPlugin) Capabilities() []plugin.Capability
- func (p *SystemdPlugin) CreateService(unit *ServiceUnit) error
- func (p *SystemdPlugin) DisableService(serviceName string) error
- func (p *SystemdPlugin) EnableService(serviceName string) error
- func (p *SystemdPlugin) GetServiceStatus(serviceName string) (string, error)
- func (p *SystemdPlugin) Init(ctx context.Context, config map[string]interface{}) error
- func (p *SystemdPlugin) Name() string
- func (p *SystemdPlugin) RestartService(serviceName string) error
- func (p *SystemdPlugin) Shutdown(ctx context.Context) error
- func (p *SystemdPlugin) StartService(serviceName string) error
- func (p *SystemdPlugin) StopService(serviceName string) error
- func (p *SystemdPlugin) Version() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceUnit ¶
type ServiceUnit struct {
Name string
Description string
After []string
Requires []string
Type string // simple, forking, oneshot, etc.
User string
Group string
WorkingDir string
ExecStart string
ExecStop string
ExecReload string
Environment map[string]string
Restart string
RestartSec int
KillMode string
// Resource limits
LimitNOFILE int
LimitNPROC int
CPUQuota string
MemoryLimit string
// Security
PrivateTmp bool
ProtectSystem string
ProtectHome bool
NoNewPrivileges bool
ReadWritePaths []string
ReadOnlyPaths []string
InaccessiblePaths []string
// Custom sections
CustomUnit string
CustomService string
CustomInstall string
}
type SystemdConfig ¶
type SystemdPlugin ¶
type SystemdPlugin struct {
// contains filtered or unexported fields
}
func New ¶
func New() *SystemdPlugin
func (*SystemdPlugin) Capabilities ¶
func (p *SystemdPlugin) Capabilities() []plugin.Capability
func (*SystemdPlugin) CreateService ¶
func (p *SystemdPlugin) CreateService(unit *ServiceUnit) error
CreateService creates a systemd service unit
func (*SystemdPlugin) DisableService ¶
func (p *SystemdPlugin) DisableService(serviceName string) error
DisableService disables a systemd service
func (*SystemdPlugin) EnableService ¶
func (p *SystemdPlugin) EnableService(serviceName string) error
EnableService enables a systemd service
func (*SystemdPlugin) GetServiceStatus ¶
func (p *SystemdPlugin) GetServiceStatus(serviceName string) (string, error)
GetServiceStatus returns the status of a service
func (*SystemdPlugin) Init ¶
func (p *SystemdPlugin) Init(ctx context.Context, config map[string]interface{}) error
func (*SystemdPlugin) Name ¶
func (p *SystemdPlugin) Name() string
func (*SystemdPlugin) RestartService ¶
func (p *SystemdPlugin) RestartService(serviceName string) error
RestartService restarts a systemd service
func (*SystemdPlugin) StartService ¶
func (p *SystemdPlugin) StartService(serviceName string) error
StartService starts a systemd service
func (*SystemdPlugin) StopService ¶
func (p *SystemdPlugin) StopService(serviceName string) error
StopService stops a systemd service
func (*SystemdPlugin) Version ¶
func (p *SystemdPlugin) Version() string
Click to show internal directories.
Click to hide internal directories.