Documentation
¶
Overview ¶
Package service registers the daemon with the OS so it starts at login: a launchd agent on macOS, a systemd user unit on Linux.
Index ¶
- Variables
- func File() string
- func Install(configPath string) error
- func LingerOff() bool
- func MenuBarAppStartsDaemon() bool
- func MissingDisplay() bool
- func NoSystemdHint() string
- func Owns(configPath string) bool
- func Restart() error
- func Start() error
- func Supported() bool
- func Uninstall() error
- type Status
Constants ¶
This section is empty.
Variables ¶
var ErrNoSystemd = errors.New("this system does not run systemd")
ErrNoSystemd means this Linux system does not run systemd, so there is no user service manager to register the daemon with.
Functions ¶
func Install ¶
Install writes the service definition and starts it. On Linux without systemd it returns ErrNoSystemd.
func LingerOff ¶
func LingerOff() bool
LingerOff reports whether systemd ends the account's user services at logout (Linux only), so the daemon neither outlives a session nor starts at boot. It is false when this cannot be determined.
func MenuBarAppStartsDaemon ¶
func MenuBarAppStartsDaemon() bool
MenuBarAppStartsDaemon reports whether the macOS menu bar app opens at login, which starts the daemon too. The app records that setting in its preferences.
func MissingDisplay ¶
func MissingDisplay() bool
MissingDisplay reports, on Linux, whether this process runs in a desktop session (a local DISPLAY or a WAYLAND_DISPLAY) while the running service's daemon has neither, so it cannot show notifications or open windows.
func NoSystemdHint ¶
func NoSystemdHint() string
NoSystemdHint explains how to start the daemon at login without systemd.
func Owns ¶
Owns reports whether the installed service runs the daemon for configPath with this process's state directory and the configured port, so starting the service starts the daemon that a client with these settings talks to. A service installed before it pinned the state directory runs with the default one.
func Restart ¶
func Restart() error
Restart stops the service's daemon, if it runs, and starts it again.