systemd

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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 SystemdConfig struct {
	UnitDir      string
	SystemctlCmd string
}

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) Shutdown

func (p *SystemdPlugin) Shutdown(ctx context.Context) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL