Documentation
¶
Overview ¶
Package systemd provides the common systemd helper functions.
Index ¶
- func DaemonReload(ctx context.Context) ([]byte, error)
- func GetUptime(service string) (*time.Duration, error)
- func GetVersion() (string, []string, error)
- func IsActive(service string) (bool, error)
- func NotifyReady(_ context.Context) error
- func NotifyStopping(_ context.Context) error
- func SystemctlExists() bool
- func SystemdExists() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 GetVersion ¶ added in v0.5.0
GetVersion returns the systemd version by running `systemd --version`.
func NotifyReady ¶ added in v0.5.0
NotifyReady notifies systemd that the daemon is ready to serve requests
func NotifyStopping ¶ added in v0.5.0
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.
Click to show internal directories.
Click to hide internal directories.