systemd

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles systemd operations using the D-Bus API

func NewManager

func NewManager(ctx context.Context) (*Manager, error)

NewManager creates a new Manager instance

func (*Manager) Close

func (sm *Manager) Close() error

Close closes the D-Bus connection

func (*Manager) GetServiceStatus

func (sm *Manager) GetServiceStatus(serviceName string) (*ServiceStatus, error)

GetServiceStatus gets the status of a systemd service

func (*Manager) ReloadDaemon

func (sm *Manager) ReloadDaemon() error

ReloadDaemon reloads the systemd daemon configuration

func (*Manager) StartService

func (sm *Manager) StartService(serviceName string) error

StartService starts a systemd service

func (*Manager) StartSystemdServices

func (sm *Manager) StartSystemdServices(services []string) error

StartSystemdServices starts multiple systemd services

func (*Manager) StopService

func (sm *Manager) StopService(serviceName string) error

StopService stops a systemd service

func (*Manager) StopSystemdServices

func (sm *Manager) StopSystemdServices(services []string) ([]string, error)

StopSystemdServices stops multiple systemd services with proper status checking

type ServiceStatus

type ServiceStatus struct {
	Name     string
	Active   bool
	Enabled  bool
	Failed   bool
	Type     string
	SubState string
}

ServiceStatus represents the status of a systemd service

Jump to

Keyboard shortcuts

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