systemduser

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package systemduser manages one explicitly requested current-user unit. It does not use sudo, system-wide managers, USB, or human systemctl status.

Index

Constants

View Source
const UnitName = "nb1.service"

Variables

View Source
var ErrUnsupported = errors.New("systemd user-service management supports ordinary Linux users only; service render remains available on other platforms")

Functions

This section is empty.

Types

type Manager

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

func New

func New() (*Manager, error)

New is Linux-only and never accepts arbitrary unit names, UIDs, manager addresses or executable paths. It performs no systemctl call or writes.

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, config service.Config, start bool) (Status, error)

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) (Status, error)

func (*Manager) Status

func (m *Manager) Status(ctx context.Context, configOnly bool) (Status, error)

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) (Status, error)

func (*Manager) Uninstall

func (m *Manager) Uninstall(ctx context.Context, stop bool) (Status, error)

type Properties

type Properties struct {
	ID               string `json:"id"`
	LoadState        string `json:"load_state"`
	ActiveState      string `json:"active_state"`
	SubState         string `json:"sub_state"`
	FragmentPath     string `json:"fragment_path"`
	SourcePath       string `json:"source_path"`
	DropInPaths      string `json:"drop_in_paths"`
	UnitFileState    string `json:"unit_file_state"`
	Transient        bool   `json:"transient"`
	NeedDaemonReload bool   `json:"need_daemon_reload"`
	Job              uint32 `json:"job"`
	NoNewPrivileges  *bool  `json:"no_new_privileges"`
}

type Result

type Result struct {
	Output    string
	ExitCode  int
	Truncated bool
}

Result is adapter data, never copied wholesale into a status or log.

type Runner

type Runner interface {
	Run(context.Context, ...string) (Result, error)
}

type Status

type Status struct {
	SchemaVersion          int             `json:"schema_version"`
	CheckedAt              time.Time       `json:"checked_at"`
	Platform               string          `json:"platform"`
	Label                  string          `json:"label"`
	Target                 string          `json:"target"`
	UnitPath               string          `json:"unit_path"`
	EnableLinkPath         string          `json:"enable_link_path"`
	ConfigState            string          `json:"config_state"`
	EnableLinkState        string          `json:"enable_link_state"`
	ManagedEnabledForLogin *bool           `json:"managed_enabled_for_login"`
	Registration           string          `json:"registration"`
	RegistrationOwned      bool            `json:"registration_owned"`
	Config                 *service.Config `json:"config"`
	Properties             *Properties     `json:"properties"`
	Actions                []string        `json:"actions"`
	Notes                  []string        `json:"notes"`
}

Status keeps disk ownership, manager loading, activity and enablement apart. ManagedEnabledForLogin describes our one persistent default.target link; UnitFileState can also reveal activation arranged elsewhere.

Jump to

Keyboard shortcuts

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