systemd

package
v1.22.5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package systemd provides utility functions for kubelet to perform systemd related operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBusCon

type DBusCon struct {
	SystemBus dBusConnector
}

DBusCon has functions that can be used to interact with systemd and logind over dbus.

func NewDBusCon added in v1.22.0

func NewDBusCon() (*DBusCon, error)

func (*DBusCon) CurrentInhibitDelay

func (bus *DBusCon) CurrentInhibitDelay() (time.Duration, error)

CurrentInhibitDelay returns the current delay inhibitor timeout value as configured in logind.conf(5). see https://www.freedesktop.org/software/systemd/man/logind.conf.html for more details.

func (*DBusCon) InhibitShutdown

func (bus *DBusCon) InhibitShutdown() (InhibitLock, error)

InhibitShutdown creates an systemd inhibitor by calling logind's Inhibt() and returns the inhibitor lock see https://www.freedesktop.org/wiki/Software/systemd/inhibit/ for more details.

func (*DBusCon) MonitorShutdown

func (bus *DBusCon) MonitorShutdown() (<-chan bool, error)

MonitorShutdown detects the a node shutdown by watching for "PrepareForShutdown" logind events. see https://www.freedesktop.org/wiki/Software/systemd/inhibit/ for more details.

func (*DBusCon) OverrideInhibitDelay

func (bus *DBusCon) OverrideInhibitDelay(inhibitDelayMax time.Duration) error

OverrideInhibitDelay writes a config file to logind overriding InhibitDelayMaxSec to the value desired.

func (*DBusCon) ReleaseInhibitLock

func (bus *DBusCon) ReleaseInhibitLock(lock InhibitLock) error

ReleaseInhibitLock will release the underlying inhibit lock which will cause the shutdown to start.

func (*DBusCon) ReloadLogindConf

func (bus *DBusCon) ReloadLogindConf() error

ReloadLogindConf uses dbus to send a SIGHUP to the systemd-logind service causing logind to reload it's configuration.

type InhibitLock

type InhibitLock uint32

InhibitLock is a lock obtained after creating an systemd inhibitor by calling InhibitShutdown().

Jump to

Keyboard shortcuts

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