Documentation
¶
Overview ¶
Package layout decides where runner keeps its files: FHS locations for root and the XDG base directories for everyone else, with macOS logs under ~/Library/Logs where Console.app and launchd expect them.
Index ¶
Constants ¶
const ( SystemConfigFile = "/etc/runner/config.toml" SystemLogRoot = "/var/log" SystemLogFile = "/var/log/runner/runner.log" )
const ServiceScopeEnv = "RUNNER_SERVICE_SCOPE"
ServiceScopeEnv names the installation scope a generated service definition was written for; it selects the system or user layout.
Variables ¶
This section is empty.
Functions ¶
func SystemLogsDirectory ¶
SystemLogsDirectory reports logFile's directory relative to SystemLogRoot when it is strictly below it and every component uses only characters systemd's LogsDirectory= accepts unescaped. The system unit and root's runtime log decision share this rule so they always agree.
Types ¶
type Identity ¶
type Identity struct {
// ServiceScope describes the installation, not the process privilege.
// It selects paths only and never grants access to them.
ServiceScope string
GOOS string // "linux" or "darwin"
Root bool // effective UID is 0
Home string // $HOME as seen by this process; "" when unset
XDGConfigHome string // honored only when absolute
XDGStateHome string // honored only when absolute
}
Identity is everything that decides where runner keeps its files.
func CurrentIdentity ¶
func CurrentIdentity() Identity
CurrentIdentity describes the running process. It never fails: root needs no home directory, and users need one only where XDG does not apply.
func (Identity) ConfigHome ¶
ConfigHome is $XDG_CONFIG_HOME when absolute, otherwise ~/.config.
func (Identity) DirPerm ¶
DirPerm is the mode for directories runner creates: world-readable system directories, private per-user ones as the XDG specification requires.