systemd

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 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 DaemonReload

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

func GetUptime

func GetUptime(service string) (*time.Duration, error)

GetUptime returns the uptime duration of the systemd service. Returns nil if the service is not found (thus uptime is not applicable, "n/a"). ref. https://github.com/kubernetes/node-problem-detector/blob/c4e5400ed6d7ca30d3a803248ae5b55c53557e59/pkg/healthchecker/health_checker_linux.go

func GetVersion added in v0.5.0

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

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

func IsActive

func IsActive(service string) (bool, error)

IsActive returns true if the systemd service is active. TODO: deprecate this

func NotifyReady added in v0.5.0

func NotifyReady(_ context.Context) error

NotifyReady notifies systemd that the daemon is ready to serve requests

func NotifyStopping added in v0.5.0

func NotifyStopping(_ context.Context) error

NotifyStopping notifies systemd that the daemon is about to be stopped

func SystemctlExists

func SystemctlExists() bool

func SystemdExists

func SystemdExists() bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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