Documentation
¶
Overview ¶
Package service renders reviewable per-user startup configurations and manages explicitly requested macOS user agents. Rendering alone never registers, enables, starts or stops an operating-system service.
Index ¶
- Constants
- Variables
- func ResolveBoundExecutable(binary, root string, uid int) (string, error)
- func WriteUserStatus(output io.Writer, status UserStatus) error
- type Artifact
- type CommandResult
- type Config
- type Runner
- type UserManager
- func (m *UserManager) Install(ctx context.Context, config Config, start bool) (UserStatus, error)
- func (m *UserManager) Start(ctx context.Context) (UserStatus, error)
- func (m *UserManager) Status(ctx context.Context, configOnly bool) (UserStatus, error)
- func (m *UserManager) Stop(ctx context.Context) (UserStatus, error)
- func (m *UserManager) Uninstall(ctx context.Context, stop bool) (UserStatus, error)
- type UserStatus
Constants ¶
const Label = "org.b1ug.nb1"
Variables ¶
var ErrUserServiceUnsupported = errors.New("automatic user-service management in this adapter supports macOS only; service render remains available on other platforms; launchctl is not invoked")
Functions ¶
func ResolveBoundExecutable ¶
ResolveBoundExecutable validates a deliberately updatable package entry. Fixed-path installations do not use this policy. The package rack remains canonical and a target must stay inside it after every link resolution.
func WriteUserStatus ¶
func WriteUserStatus(output io.Writer, status UserStatus) error
Types ¶
type Artifact ¶
type CommandResult ¶
CommandResult is an internal adapter result. Output may contain launchd diagnostic data, so it must never be copied wholesale to reports or logs.
type Config ¶
type Config struct {
Platform string `json:"platform"`
Binary string `json:"binary"`
BinaryRoot string `json:"binary_root,omitempty"`
ConfigFile string `json:"config_file,omitempty"`
UserConfigRoot string `json:"user_config_root,omitempty"`
Devices []string `json:"devices"`
Listen string `json:"listen"`
LockDir string `json:"lock_dir"`
}
type UserManager ¶
type UserManager struct {
// contains filtered or unexported fields
}
func NewUserManager ¶
func NewUserManager() (*UserManager, error)
NewUserManager only addresses this ordinary user's fixed GUI LaunchAgent. No arbitrary labels, UIDs, launchctl paths or installation directories are accepted by the CLI. Construction performs no writes or launchctl calls.
func (*UserManager) Install ¶
func (m *UserManager) Install(ctx context.Context, config Config, start bool) (UserStatus, error)
Install never replaces a file, including a changed configuration previously installed by this tool. start is the explicit live bootstrap boundary.
func (*UserManager) Start ¶
func (m *UserManager) Start(ctx context.Context) (UserStatus, error)
Start loads only a complete, existing managed configuration. A matching registration is already started for this command's purpose; never restart it.
func (*UserManager) Status ¶
func (m *UserManager) Status(ctx context.Context, configOnly bool) (UserStatus, error)
Status with configOnly performs filesystem reads only. It creates no directories or lock files and never calls launchctl in that mode.
func (*UserManager) Stop ¶
func (m *UserManager) Stop(ctx context.Context) (UserStatus, error)
Stop removes only the verified registration and deliberately retains the plist. This does not disable automatic loading at the next GUI login.
func (*UserManager) Uninstall ¶
func (m *UserManager) Uninstall(ctx context.Context, stop bool) (UserStatus, error)
Uninstall always queries launchd first. stop authorizes bootout only after both the on-disk marker and the exact loaded path/program have been checked. It never treats a query error or unknown output format as 'not loaded'.
type UserStatus ¶
type UserStatus struct {
SchemaVersion int `json:"schema_version"`
Label string `json:"label"`
Target string `json:"target"`
PlistPath string `json:"plist_path"`
ConfigState string `json:"config_state"`
Registration string `json:"registration"`
RegistrationOwned bool `json:"registration_owned"`
AutoLoadAtLogin *bool `json:"auto_load_at_login"`
Config *Config `json:"config"`
Actions []string `json:"actions"`
Notes []string `json:"notes"`
}
UserStatus distinguishes a known on-disk configuration from launchd registration. Registered does not mean running, HTTP-ready or USB-online.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package systemduser manages one explicitly requested current-user unit.
|
Package systemduser manages one explicitly requested current-user unit. |
|
Package taskquery reads one fixed current-user Task Scheduler registration.
|
Package taskquery reads one fixed current-user Task Scheduler registration. |
|
Package taskuser verifies only the current Windows process's read-only identity.
|
Package taskuser verifies only the current Windows process's read-only identity. |