systemdctl

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultContext

func DefaultContext() (context.Context, context.CancelFunc)

func UnitNameForGameID

func UnitNameForGameID(gameID string) string

UnitNameForGameID turns an arbitrary game identifier into a stable, safe systemd scope unit name: game-<id>.scope.

Types

type Systemctl

type Systemctl struct {
	DryRun bool
}

func (Systemctl) GetAllowedCPUs

func (s Systemctl) GetAllowedCPUs(ctx context.Context, unit string) (string, error)

func (Systemctl) SetAllowedCPUs

func (s Systemctl) SetAllowedCPUs(ctx context.Context, unit string, cpus string) error

func (Systemctl) StartUnit

func (s Systemctl) StartUnit(ctx context.Context, unit string) error

type UserManager

type UserManager struct {
	DryRun bool
	// contains filtered or unexported fields
}

func NewUserManager

func NewUserManager(dryRun bool) (*UserManager, error)

func (*UserManager) AttachProcessesToUnit

func (m *UserManager) AttachProcessesToUnit(ctx context.Context, unit string, subcgroup string, pids []int) error

AttachProcessesToUnit attaches the given PIDs to an existing systemd unit. The systemd D-Bus signature is: (s unit, s subcgroup, au pids).

func (*UserManager) Close

func (m *UserManager) Close() error

func (*UserManager) EnsureTransientScope

func (m *UserManager) EnsureTransientScope(ctx context.Context, scopeName string, pids []int, slice string, description string) (created bool, err error)

EnsureTransientScope creates a transient scope (if missing) and attaches PIDs. It is safe to call repeatedly.

Jump to

Keyboard shortcuts

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