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
- Variables
- func Control(o Options, action string) error
- func Install(o Options) error
- func Interactive() bool
- func New(o Options, run func(ctx context.Context) error) (service.Service, error)
- func Run(s service.Service) error
- func Status(o Options) (string, error)
- func SystemdUnit(o Options) string
- type Options
Constants ¶
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.
const Name = "SkinLoom"
Name is the service name on every system.
Variables ¶
var ErrNotInstalled = service.ErrNotInstalled
ErrNotInstalled is returned for a service that is not installed.
Functions ¶
func Interactive ¶
func Interactive() bool
Interactive is false when the process was started by the service manager.
func New ¶
New returns the service for o. run serves the site until its context is cancelled; it is used only by Run.
func SystemdUnit ¶
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.