systemd

package
v0.24.7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package systemd provides systemd-specific platform implementations.

Index

Constants

View Source
const (
	UnitSuffixContainer = ".container"
	UnitSuffixNetwork   = ".network"
	UnitSuffixVolume    = ".volume"
	UnitSuffixBuild     = ".build"
	UnitSuffixService   = ".service"
)

Unit type suffix constants for Quadlet unit files. These suffixes distinguish different types of managed resources in systemd dependencies.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lifecycle

type Lifecycle struct {
	// contains filtered or unexported fields
}

Lifecycle implements the platform.Lifecycle interface for systemd.

func NewLifecycle

func NewLifecycle(
	unitManager systemd.UnitManager,
	connectionFactory systemd.ConnectionFactory,
	userMode bool,
	logger log.Logger,
) *Lifecycle

NewLifecycle creates a new systemd Lifecycle implementation.

func (*Lifecycle) Name

func (l *Lifecycle) Name() string

Name returns the platform name.

func (*Lifecycle) Reload

func (l *Lifecycle) Reload(ctx context.Context) error

Reload reloads the service manager configuration.

func (*Lifecycle) Restart

func (l *Lifecycle) Restart(ctx context.Context, name string) error

Restart restarts a service.

func (*Lifecycle) RestartMany

func (l *Lifecycle) RestartMany(ctx context.Context, names []string) map[string]error

RestartMany restarts multiple services in dependency order.

func (*Lifecycle) SetUnitGenerationTimeout added in v0.24.7

func (l *Lifecycle) SetUnitGenerationTimeout(timeout time.Duration)

SetUnitGenerationTimeout sets the timeout for waiting for units to be generated. This is primarily useful for testing.

func (*Lifecycle) Start

func (l *Lifecycle) Start(ctx context.Context, name string) error

Start starts a service.

func (*Lifecycle) StartMany

func (l *Lifecycle) StartMany(ctx context.Context, names []string) map[string]error

StartMany starts multiple services in dependency order.

func (*Lifecycle) Status

func (l *Lifecycle) Status(ctx context.Context, name string) (*platform.ServiceStatus, error)

Status returns the status of a service.

func (*Lifecycle) Stop

func (l *Lifecycle) Stop(ctx context.Context, name string) error

Stop stops a service.

func (*Lifecycle) StopMany

func (l *Lifecycle) StopMany(ctx context.Context, names []string) map[string]error

StopMany stops multiple services in reverse dependency order.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer implements platform.Renderer for systemd/Quadlet.

func NewRenderer

func NewRenderer(logger log.Logger) *Renderer

NewRenderer creates a new systemd renderer.

func (*Renderer) Name

func (r *Renderer) Name() string

Name returns the platform name.

func (*Renderer) Render

func (r *Renderer) Render(_ context.Context, specs []service.Spec) (*platform.RenderResult, error)

Render converts service specs to systemd Quadlet unit files.

Jump to

Keyboard shortcuts

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