Expand description
The background service: stopping the containers QCode started once no QCode is open.
Four parts, each usable on its own:
stopis the work itself: read the list of QCode’s containers, stop the ones that run, keep listed what could not be stopped.Openis what every running QCode holds for its whole life: a shared lock oninstances.lockbeside the list. Closing it is where the last QCode to close does the work itself, so containers are stopped on a normal exit even with no service installed.reaperis whatqcode reaperruns: it waits in the kernel for the exclusive lock on the same file, which it gets only once no QCode holds it, however the last one went.unitsmakes the systemd and launchd files that runqcode reaperwhen the list changes, and the steps that install and remove them.
The lock is the kernel’s (flock), so a QCode that crashes or is killed holds nothing and
keeps nobody waiting. Windows has no such lock for QCode: there every call answers
io::ErrorKind::Unsupported, nothing is held and nothing is stopped.
Modules§
- stop
- Stopping the containers no QCode owns any more.
- units
- The files that install the background service, and the steps that put them in place or take them away.
Structs§
- Engines
- How the containers are reached:
engine_forfinds the engine of a kind,runruns one command and answers what it printed. The real ones arecrate::engine::detectandcrate::engine::run::capture; a test passes its own. - Open
- A running QCode, as the other QCodes and the service see it: a shared lock on the lock file, held for as long as this value lives.
- Places
- Where the list of QCode’s containers and the lock of the open QCodes are kept.
Constants§
- LOCK_
FILE - The name of the file every open QCode holds a shared lock on, beside the list.
Functions§
- reaper
- What
qcode reaperdoes: waits until no QCode is open, stops the listed containers if the setting says to, empties the list, and writes tooutwhat it did. - report
- What a reaper run has to say about
reaped, one line each, in the language in force. - translator
- The text of
qcode reaper, in the language the person chose in QCode or else the machine’s.