kubernetes: k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd Index | Files

package systemd

import "k8s.io/kubernetes/pkg/kubelet/nodeshutdown/systemd"

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


Package Files

doc.go inhibit_linux.go

type DBusCon Uses

type DBusCon struct {
    SystemBus dBusConnector

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

func (*DBusCon) CurrentInhibitDelay Uses

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 Uses

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 Uses

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 Uses

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

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

func (*DBusCon) ReleaseInhibitLock Uses

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

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

func (*DBusCon) ReloadLogindConf Uses

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 Uses

type InhibitLock uint32

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

Package systemd imports 8 packages (graph) and is imported by 1 packages. Updated 2021-01-20. Refresh now. Tools for package owners.