Documentation ¶
Overview ¶
Package systemd provides utility functions for kubelet to perform systemd related operations.
Index ¶
- type DBusCon
- func (bus *DBusCon) CurrentInhibitDelay() (time.Duration, error)
- func (bus *DBusCon) InhibitShutdown() (InhibitLock, error)
- func (bus *DBusCon) MonitorShutdown() (<-chan bool, error)
- func (bus *DBusCon) OverrideInhibitDelay(inhibitDelayMax time.Duration) error
- func (bus *DBusCon) ReleaseInhibitLock(lock InhibitLock) error
- func (bus *DBusCon) ReloadLogindConf() error
- type InhibitLock
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 (*DBusCon) CurrentInhibitDelay ¶
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 ¶
MonitorShutdown detects the node shutdown by watching for "PrepareForShutdown" logind events. see https://www.freedesktop.org/wiki/Software/systemd/inhibit/ for more details.
func (*DBusCon) OverrideInhibitDelay ¶
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 ¶
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().