Expand description
choir node install — hand the node to whatever supervises services
on this machine, so it survives a logout, a crash and a reboot.
§The unit names a command, not a configuration
The rendered unit runs choir node serve, and nothing else. Every
path and flag the daemon needs is derived at start time from the
state directory, which means the supervision file never has to be
re-rendered because a flag changed — the failure mode of the shell
scripts this replaces, where a plist that lints clean and restarts
cleanly can still launch yesterday’s arguments.
§Examples
use choir_cli::supervise::Supervisor;
// Whichever this machine has; the rendering is the same shape either way.
let unit = Supervisor::Launchd.render(
std::path::Path::new("/usr/local/bin/choir"),
std::path::Path::new("/home/example/.choir"),
8417,
&[],
);
assert!(unit.contains("choir"));Enums§
- Action
- What
commandsshould produce. - Supervisor
- The service manager this machine runs.
Constants§
- LABEL
- The reverse-DNS label and unit stem. One name, used by both, so the thing to grep for is the same wherever it is running.
Functions§
- in_
build_ directory - Whether this executable is sitting in a cargo build directory.