Documentation
¶
Overview ¶
Package problemrec records the problems of the intuneme CLI in the local systemd journal, through github.com/frostyard/std/problems (schema frostyard.problem/1 of frostyard/core).
It records 2 kinds of problem:
- a panic: main defers RecoverPanic on the process-wide recorder, and CrashOutput turns the crash file of an earlier process that died of a panic in another goroutine, or of a fatal error, into a record at the next start;
- a coded internal error: Error, at the failure points named by the Code constants. A code is recorded only for an internal failure after config validation and sudo authentication passed: user setup and authentication errors (not initialized, not running, failed sudo authentication, a bad config, an untrusted helper source) are never recorded.
A record is 1 datagram to the local journal socket. The package sends nothing over a network, adds no flag, and writes nothing to stdout or stderr. A record that the journal cannot take is dropped. std caps the records of 1 process at 10 a minute.
Only a release build records: ReleaseVersion turns the stamped version into the record version, and a development version makes the recorder inert.
The recorder starts in main only after the dispatch of the privileged helpers (nshelper.Main, nshelper.MachineMain), so the root helpers never record.
Index ¶
Constants ¶
const ( // CodeBootFailed: systemd-nspawn did not start, or the machine was not // registered within 30 seconds. CodeBootFailed = "start.boot_failed" // CodeLingerFailed: start could not enable linger for the container // user (the already-running path or the cold-boot path). CodeLingerFailed = "start.linger_failed" // CodeProxyFailed: start could not start the broker, notify or // screencast proxy. CodeProxyFailed = "start.proxy_failed" // CodeSessionBusTimeout: open could not launch the app because the // container user session bus did not appear in time // (nspawn.ErrSessionBusTimeout). CodeSessionBusTimeout = "open.session_bus_timeout" )
Codes of the coded internal errors (FROSTYARD_CODE). A code is a stable contract: add a new code, never rename or reuse one. Record a code only where the failure cannot come from user config or sudo authentication.
const AppID = "org.frostyard.intuneme"
AppID is the frostyard app ID of intuneme in the problem record allowlist.
const Component = problems.ComponentCLI
Component is the part of intuneme that records: the CLI.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
Error records the coded internal error err under code. The error text goes only to the journal MESSAGE field. It never blocks, never fails, and does nothing when the recorder is nil or inert.
func Init ¶
Init makes the process-wide recorder for the build version, stores it and returns it. Only tests give options (problems.WithSocket).
func ReleaseVersion ¶
ReleaseVersion returns the record version of the stamped build version v: v without 1 leading "v". GoReleaser stamps "0.21.0"; `make build` stamps `git describe` output such as "v0.21.0". A development version ("dev", a "-N-gHASH" or "-dirty" describe suffix, a snapshot version) is not a release semver after the trim, so the recorder made from it is inert and records nothing.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package problemrectest gives tests a local journal test socket for the problem records of intuneme.
|
Package problemrectest gives tests a local journal test socket for the problem records of intuneme. |