systemd

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package systemd provides the common systemd helper functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckVersion

func CheckVersion() (string, []string, error)

CheckVersion returns the systemd version by running `systemd --version`.

func DaemonReload

func DaemonReload(ctx context.Context) ([]byte, error)

func GetLatestJournalctlOutput added in v0.0.2

func GetLatestJournalctlOutput(ctx context.Context, svcName string) (string, error)

Fetches the latest/recent journal outputs using "journalctl". Equivalent to "journalctl -xeu [service name].service --no-pager".

func IsActive

func IsActive(service string) (bool, error)

IsActive returns true if the systemd service is active.

func JournalctlExists added in v0.0.2

func JournalctlExists() bool

func SystemctlExists

func SystemctlExists() bool

func SystemdExists

func SystemdExists() bool

Types

type DbusConn

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

func NewDbusConn

func NewDbusConn(ctx context.Context) (*DbusConn, error)

Caller should explicitly close the connection by calling Close() on returned connection object

func (*DbusConn) Close

func (c *DbusConn) Close()

func (*DbusConn) IsActive

func (c *DbusConn) IsActive(ctx context.Context, unitName string) (bool, error)

Jump to

Keyboard shortcuts

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