systemd

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetUnitConfigurationFilePath = func(unitName string, ctx *log.Context) (string, error) {
	base_path, err := GetSystemDConfigurationBasePath(ctx)
	if err != nil {
		return "", err
	}
	return path.Join(base_path, unitName), nil
}

Functions

func GetSystemDConfigurationBasePath

func GetSystemDConfigurationBasePath(ctx *log.Context) (string, error)

func IsSystemDPresent

func IsSystemDPresent() bool

Types

type Manager

type Manager struct {
}

func NewUnitManager

func NewUnitManager() *Manager

func (*Manager) CreateUnitConfigurationFile

func (*Manager) CreateUnitConfigurationFile(unitName string, content []byte, ctx *log.Context) error

func (*Manager) DaemonReload

func (mgr *Manager) DaemonReload(unitName string, ctx *log.Context) error

func (*Manager) DisableUnit

func (mgr *Manager) DisableUnit(unitName string, ctx *log.Context) error

func (*Manager) EnableUnit

func (mgr *Manager) EnableUnit(unitName string, ctx *log.Context) error

func (*Manager) GetInstalledVersion

func (*Manager) GetInstalledVersion(unitName string, ctx *log.Context) (string, error)

Gets the installed version of the extension. The version will look at the service definition and extract it from the ExecStart field as there isn't a way to include a version parameter in the definition. The field looks as follows: ExecStart=/var/lib/waagent/Microsoft.CPlat.Core.RunCOmmandHandlerLinux-1.0.0/bin/immediate-run-command-handler

func (*Manager) IsUnitActive

func (mgr *Manager) IsUnitActive(unitName string, ctx *log.Context) error

func (*Manager) IsUnitEnabled

func (mgr *Manager) IsUnitEnabled(unitName string, ctx *log.Context) (bool, error)

func (*Manager) IsUnitInstalled

func (mgr *Manager) IsUnitInstalled(unitName string, ctx *log.Context) (bool, error)

func (*Manager) RemoveUnitConfigurationFile

func (*Manager) RemoveUnitConfigurationFile(unitName string, ctx *log.Context) error

func (*Manager) StartUnit

func (mgr *Manager) StartUnit(unitName string, ctx *log.Context) error

func (*Manager) StopUnit

func (mgr *Manager) StopUnit(unitName string, ctx *log.Context) error

Jump to

Keyboard shortcuts

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