Skip to main content

Module units

Module units 

Source
Expand description

The files that install the background service, and the steps that put them in place or take them away.

Linux gets two systemd user units: qcode-reaper.path watches the list of QCode’s containers and starts qcode-reaper.service when QCode writes to it, and the service runs qcode reaper once and exits. macOS gets one launchd job that does the same with WatchPaths. Windows gets nothing, because what the service waits on is a lock Windows does not give QCode.

Every file is text made by a pure function of a ServiceHost, and installing is a list of Steps — files to write, files to remove, commands to run — so the whole of it is read back in tests against a temporary folder, with the commands collected rather than run. Only perform with run_host touches the machine, and only the settings screen’s button calls it.

Structs§

HostCommand
A program and its arguments, run on the machine itself: systemctl or launchctl.
ServiceHost
Everything about the machine the service files are made for.

Enums§

Step
One thing installing or removing the service does, in order.

Constants§

LAUNCHD_LABEL
The launchd label of the job on macOS.
PATH_UNIT
The unit that watches the list and starts SERVICE_UNIT.
REAPER_ARG
The word qcode is started with to run the reaper.
SERVICE_UNIT
The unit that runs the reaper once.

Functions§

perform
Carries out steps in order, stopping at the first that fails, and answers why it failed in words the person can read: the command’s own when a command failed.
run_host
Runs command on this machine and waits for it.