systemd

package
v0.65.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package systemd offers an interface over systemd

Index

Constants

View Source
const (
	// UnitsPath is the path where systemd unit files are stored
	UnitsPath = "/etc/systemd/system"
)

Variables

This section is empty.

Functions

func DisableUnit

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

DisableUnit disables a systemd unit

func EnableUnit

func EnableUnit(ctx context.Context, unit string) (err 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 Reload

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

Reload reloads the systemd daemon

func RemoveUnit

func RemoveUnit(ctx context.Context, unit string) (err error)

RemoveUnit removes a systemd unit

func StartUnit

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

StartUnit starts a systemd unit

func StopUnit

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

StopUnit starts a systemd unit

func WriteEmbeddedUnit

func WriteEmbeddedUnit(ctx context.Context, unit string) (err error)

WriteEmbeddedUnit writes a systemd unit from embedded resources

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