systemd

package
v0.75.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package systemd provides a set of functions to manage systemd units

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableUnit

func DisableUnit(ctx context.Context, unit string) error

DisableUnit disables a systemd unit

func DisableUnits added in v0.68.0

func DisableUnits(ctx context.Context, units ...string) error

DisableUnits disables multiple systemd units

func EnableUnit

func EnableUnit(ctx context.Context, unit string) error

EnableUnit enables a systemd unit

func IsRunning

func IsRunning() (running bool, err error)

IsRunning checks if systemd is running using the documented way https://www.freedesktop.org/software/systemd/man/latest/sd_booted.html#Notes

func JournaldLogs added in v0.68.0

func JournaldLogs(ctx context.Context, unit string, since time.Time) (string, error)

JournaldLogs returns the logs for a given unit since a given time

func Reload

func Reload(ctx context.Context) (err error)

Reload reloads the systemd daemon

func RestartUnit

func RestartUnit(ctx context.Context, unit string, args ...string) error

RestartUnit restarts a systemd unit

func StartUnit

func StartUnit(ctx context.Context, unit string, args ...string) error

StartUnit starts a systemd unit

func StopUnit

func StopUnit(ctx context.Context, unit string, args ...string) error

StopUnit starts a systemd unit

func StopUnits

func StopUnits(ctx context.Context, units ...string) error

StopUnits stops multiple systemd units

func WriteUnitOverride

func WriteUnitOverride(ctx context.Context, unit string, name string, content string) (err error)

WriteUnitOverride writes a systemd unit override

Types

This section is empty.

Jump to

Keyboard shortcuts

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