systemctl

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner interface {
	Run(args ...string) error
	RunQuiet(args ...string) error
}

Runner is the subset of environment.GuestActions that Systemctl requires. Using a narrow interface makes Systemctl easier to test and more loosely coupled.

type Systemctl

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

Systemctl provides a typed wrapper for running systemctl commands in the guest VM.

func New

func New(guest Runner) Systemctl

New creates a new Systemctl instance backed by the given guest.

func (Systemctl) Active

func (s Systemctl) Active(service string) bool

Active returns whether a systemd service is currently active.

func (Systemctl) DaemonReload

func (s Systemctl) DaemonReload() error

DaemonReload reloads the systemd manager configuration.

func (Systemctl) Restart

func (s Systemctl) Restart(service string) error

Restart restarts a systemd service.

func (Systemctl) Start

func (s Systemctl) Start(service string) error

Start starts a systemd service.

func (Systemctl) Stop

func (s Systemctl) Stop(service string, force bool) error

Stop stops a systemd service. If force is true, it is killed immediately without graceful shutdown.

Jump to

Keyboard shortcuts

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