daemon

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package daemon installs SkinLoom as a background service of the operating system (docs/design/04 §9.1, 02 F76): a systemd unit on Linux, a launchd daemon on macOS, a Windows service. The service runs "skinloom service run", which serves the site like "skinloom up" and answers the service manager's start and stop.

Index

Constants

View Source
const LogFile = "logs/skinloom.log"

LogFile is where a service run logs when the config names no log.file: nobody reads a service's console. Relative to the data directory.

View Source
const Name = "SkinLoom"

Name is the service name on every system.

Variables

View Source
var ErrNotInstalled = service.ErrNotInstalled

ErrNotInstalled is returned for a service that is not installed.

Functions

func Control

func Control(o Options, action string) error

Control runs one of install's companions: uninstall, start, stop, restart.

func Install

func Install(o Options) error

Install registers the service and gives it write access to what it writes.

func Interactive

func Interactive() bool

Interactive is false when the process was started by the service manager.

func New

func New(o Options, run func(ctx context.Context) error) (service.Service, error)

New returns the service for o. run serves the site until its context is cancelled; it is used only by Run.

func Run

func Run(s service.Service) error

Run serves under the service manager: it returns when the service is stopped.

func Status

func Status(o Options) (string, error)

Status reports running, stopped or ErrNotInstalled.

func SystemdUnit

func SystemdUnit(o Options) string

SystemdUnit is the unit file written on Linux, for validated options. It has no {{ }}: the library runs it through text/template and must get it back unchanged.

Types

type Options

type Options struct {
	Exe        string // absolute path of the skinloom binary
	DataDir    string // absolute
	ConfigPath string // "" = <DataDir>/config.toml
	// User runs the service on Linux and macOS ("" = the system's default, root).
	// Windows services run as LOCAL SERVICE.
	User string
}

Options describe an installed service.

Jump to

Keyboard shortcuts

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