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
- Variables
- type Manager
- func (m *Manager) Install(ctx context.Context, config service.Config, start bool) (Status, error)
- func (m *Manager) Start(ctx context.Context) (Status, error)
- func (m *Manager) Status(ctx context.Context, configOnly bool) (Status, error)
- func (m *Manager) Stop(ctx context.Context) (Status, error)
- func (m *Manager) Uninstall(ctx context.Context, stop bool) (Status, error)
- type Properties
- type Result
- type Runner
- type Status
Constants ¶
const UnitName = "nb1.service"
Variables ¶
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 ¶
New is Linux-only and never accepts arbitrary unit names, UIDs, manager addresses or executable paths. It performs no systemctl call or writes.
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 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.