Documentation ¶
Overview ¶
Package systemd provides the common systemd helper functions.
Index ¶
- func CheckVersion() (string, []string, error)
- func DaemonReload(ctx context.Context) ([]byte, error)
- func GetLatestJournalctlOutput(ctx context.Context, svcName string) (string, error)
- func GetUptime(service string) (*time.Duration, error)
- func IsActive(service string) (bool, error)
- func JournalctlExists() bool
- func SystemctlExists() bool
- func SystemdExists() bool
- type DbusConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
CheckVersion returns the systemd version by running `systemd --version`.
func GetLatestJournalctlOutput ¶ added in v0.0.2
Fetches the latest/recent journal outputs using "journalctl". Equivalent to "journalctl -xeu [service name].service --no-pager".
func GetUptime ¶
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 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 ¶
Caller should explicitly close the connection by calling Close() on returned connection object
Click to show internal directories.
Click to hide internal directories.