systemd

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package systemd contains the trusted target and transport implementation used by systemd-aware builtins.

Index

Constants

View Source
const MaxJournalDirs = 8

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the trusted systemd backends for one resolved target. Target paths are copied at construction so runner configuration remains immutable while commands execute.

func NewClient

func NewClient(target Target) *Client

NewClient creates a client for one resolved systemd target.

func (*Client) DisableSystemServices

func (*Client) DisableSystemServices(context.Context, []string) error

func (*Client) EnableSystemServices

func (*Client) EnableSystemServices(context.Context, []string) error

func (*Client) InspectSystemServices

func (*Client) InspectSystemServices(context.Context, []string) ([]builtins.SystemServiceState, error)

func (*Client) JournalDiskUsage

func (c *Client) JournalDiskUsage(context.Context) (builtins.JournalUsage, error)

JournalDiskUsage requires Unix allocation metadata.

func (*Client) ReadJournal

func (c *Client) ReadJournal(ctx context.Context, query builtins.JournalQuery, yield func(builtins.JournalEntry) error) error

ReadJournal reads a bounded structured query from the configured journal files. Results are buffered until the file snapshot is stable, then yielded oldest first as required by builtins.JournalReader.

func (*Client) RotateJournal

func (c *Client) RotateJournal(context.Context) error

RotateJournal requires a Linux systemd-journald control endpoint.

func (*Client) RunSystemServiceJobs

func (*Client) RunSystemServiceJobs(context.Context, builtins.SystemServiceJobAction, []string) error

func (*Client) VacuumJournal

VacuumJournal requires rooted Unix filesystem operations.

type Target

type Target struct {
	JournalDirs          []string
	MachineIDPath        string
	JournalControlSocket string
	ManagerBusSocket     string
}

Target identifies one systemd host through journal paths supplied by the embedding application.

func LocalTarget

func LocalTarget() Target

LocalTarget returns the standard paths for the local systemd host.

func ResolveTarget

func ResolveTarget(target Target) (Target, error)

ResolveTarget validates and resolves a target. A zero target selects the local host. Once any explicit field is supplied, omitted fields remain empty and never fall back to local paths.

Jump to

Keyboard shortcuts

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