launchd

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 11 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

Index

Constants

View Source
const DaemonPlistPath = daemonPlistPath

DaemonPlistPath is the system-wide launchd plist installed when the agent runs as root. Exported so other packages (notably telemetry's invocation detector) can check for an installed footprint without re-deriving the path.

View Source
const Label = label

Label is the launchd job label for the agent. Exported so other packages (e.g. schedinfo) can address the job without re-deriving the constant.

Variables

This section is empty.

Functions

func DomainTarget added in v1.13.0

func DomainTarget(exec executor.Executor) (domain, target string)

DomainTarget returns the launchd domain and the domain/label service target for the current privilege level: the system domain for a root LaunchDaemon, gui/<uid> for a per-user LaunchAgent. Single source of truth for the domain math reused by Install/Uninstall and the scheduler-info collector.

func Install

func Install(exec executor.Executor, log *progress.Logger) error

Install configures launchd for periodic scanning and loads the job (upgrading in place if already installed). With RunAtLoad=true, loading the job triggers the run immediately — so this load IS the initial scan and the install command deliberately does NOT scan inline on macOS (see main.go). Doing both would double-scan at install: once inline, once at load, with the second blocked on the singleton lock.

func Uninstall

func Uninstall(exec executor.Executor, log *progress.Logger) error

Uninstall removes the launchd configuration.

func UserPlistPath added in v1.11.4

func UserPlistPath() string

UserPlistPath returns the per-user launchd plist path installed when the agent runs without root. Empty when the home directory cannot be resolved.

Types

This section is empty.

Jump to

Keyboard shortcuts

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