Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultContext ¶
func DefaultContext() (context.Context, context.CancelFunc)
func UnitNameForGameID ¶
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 (Systemctl) SetAllowedCPUs ¶
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.
Click to show internal directories.
Click to hide internal directories.