systemd

package
v0.102.2-nightly Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: AGPL-3.0 Imports: 6 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 manages systemd units for namespace services

func NewManager

func NewManager(namespaceBase string, logger *zap.Logger) *Manager

NewManager creates a new systemd manager

func (*Manager) CleanupOrphanedProcesses

func (m *Manager) CleanupOrphanedProcesses() error

CleanupOrphanedProcesses finds and kills any orphaned namespace processes not managed by systemd This is for cleaning up after migration from old exec.Command approach

func (*Manager) DisableService

func (m *Manager) DisableService(namespace string, serviceType ServiceType) error

DisableService disables a namespace service

func (*Manager) EnableService

func (m *Manager) EnableService(namespace string, serviceType ServiceType) error

EnableService enables a namespace service to start on boot

func (*Manager) GenerateEnvFile

func (m *Manager) GenerateEnvFile(namespace, nodeID string, serviceType ServiceType, envVars map[string]string) error

GenerateEnvFile creates the environment file for a namespace service

func (*Manager) InstallTemplateUnits

func (m *Manager) InstallTemplateUnits(sourceDir string) error

InstallTemplateUnits installs the systemd template unit files

func (*Manager) IsServiceActive

func (m *Manager) IsServiceActive(namespace string, serviceType ServiceType) (bool, error)

IsServiceActive checks if a namespace service is active

func (*Manager) ListNamespaceServices

func (m *Manager) ListNamespaceServices() ([]string, error)

ListNamespaceServices returns all namespace services currently registered in systemd

func (*Manager) ReloadDaemon

func (m *Manager) ReloadDaemon() error

ReloadDaemon reloads systemd daemon configuration

func (*Manager) RestartService

func (m *Manager) RestartService(namespace string, serviceType ServiceType) error

RestartService restarts a namespace service

func (*Manager) StartAllNamespaceServices

func (m *Manager) StartAllNamespaceServices(namespace string) error

StartAllNamespaceServices starts all namespace services for a given namespace

func (*Manager) StartService

func (m *Manager) StartService(namespace string, serviceType ServiceType) error

StartService starts a namespace service

func (*Manager) StopAllNamespaceServices

func (m *Manager) StopAllNamespaceServices(namespace string) error

StopAllNamespaceServices stops all namespace services for a given namespace

func (*Manager) StopAllNamespaceServicesGlobally

func (m *Manager) StopAllNamespaceServicesGlobally() error

StopAllNamespaceServicesGlobally stops ALL namespace services on this node (for upgrade/maintenance)

func (*Manager) StopService

func (m *Manager) StopService(namespace string, serviceType ServiceType) error

StopService stops a namespace service

type ServiceType

type ServiceType string

ServiceType represents the type of namespace service

const (
	ServiceTypeRQLite  ServiceType = "rqlite"
	ServiceTypeOlric   ServiceType = "olric"
	ServiceTypeGateway ServiceType = "gateway"
)

Jump to

Keyboard shortcuts

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