systemd

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotExist = errors.New("unit does not exist")

Functions

This section is empty.

Types

type EnsureControlInterface

type EnsureControlInterface interface {
	DaemonReload(ctx context.Context) error
	EnableAndStartUnit(ctx context.Context, unitFile string) error
	DisableAndStopUnit(ctx context.Context, unitFile string) error
}

type Mount

type Mount struct {
	Description string
	Device      string
	MountPoint  string
	FSType      string
	Options     []string
}

func (*Mount) MakeUnit

func (m *Mount) MakeUnit() (*NamedUnit, error)

type NamedUnit

type NamedUnit struct {
	FileName string
	Data     []byte
}

type SystemdControl

type SystemdControl struct {
	// contains filtered or unexported fields
}

func NewSystemdSystemControl

func NewSystemdSystemControl(ctx context.Context) (*SystemdControl, error)

func NewSystemdUserControl

func NewSystemdUserControl(ctx context.Context) (*SystemdControl, error)

func (*SystemdControl) Close

func (c *SystemdControl) Close()

func (*SystemdControl) DaemonReload

func (c *SystemdControl) DaemonReload(ctx context.Context) error

func (*SystemdControl) DisableAndStopUnit

func (c *SystemdControl) DisableAndStopUnit(ctx context.Context, unitFile string) error

func (*SystemdControl) DisableUnit

func (c *SystemdControl) DisableUnit(ctx context.Context, unitFile string) error

func (*SystemdControl) DisableUnits

func (c *SystemdControl) DisableUnits(ctx context.Context, unitFiles []string) error

func (*SystemdControl) EnableAndStartUnit

func (c *SystemdControl) EnableAndStartUnit(ctx context.Context, unitFile string) error

func (*SystemdControl) EnableUnit

func (c *SystemdControl) EnableUnit(ctx context.Context, unitFile string) error

func (*SystemdControl) EnableUnits

func (c *SystemdControl) EnableUnits(ctx context.Context, unitFiles []string) error

func (*SystemdControl) StartUnit

func (c *SystemdControl) StartUnit(ctx context.Context, unitFile string) error

func (*SystemdControl) StopUnit

func (c *SystemdControl) StopUnit(ctx context.Context, unitFile string) error

type UnitManager

type UnitManager struct {
	// contains filtered or unexported fields
}

func NewUnitManager

func NewUnitManager(manager string) *UnitManager

func NewUnitManagerWithPath

func NewUnitManagerWithPath(manager, rootPath string) *UnitManager

func (*UnitManager) EnsureUnits

func (m *UnitManager) EnsureUnits(ctx context.Context, nc *scyllav1alpha1.NodeConfig, recorder record.EventRecorder, requiredUnits []*NamedUnit, control EnsureControlInterface) error

EnsureUnits will make sure to remove any unit that is no longer desired and create/update those that are.

func (*UnitManager) GetUnitPath

func (m *UnitManager) GetUnitPath(name string) string

func (*UnitManager) ReadStatus

func (m *UnitManager) ReadStatus() (*unitManagerStatus, error)

func (*UnitManager) WriteStatus

func (m *UnitManager) WriteStatus(status *unitManagerStatus) error

Jump to

Keyboard shortcuts

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