headless: register signal handlers synchronously, split tests, drop deployment examples and wording
This commit was merged in pull request #2.
This commit is contained in:
@@ -48,21 +48,18 @@ From a clone (`git clone https://gitea.surma.technology/surma/sausage`), the
|
||||
same commands are `nix run`, `nix run -- init`, `nix run -- run` and
|
||||
`nix run .#loop`.
|
||||
|
||||
### As a service (headless)
|
||||
### Headless
|
||||
|
||||
Without a terminal (systemd, a container), stdin is `/dev/null` and EOF would
|
||||
stop the world. `--headless` (or `SAUSAGE_HEADLESS=1`) turns the console
|
||||
input off: the host runs until SIGTERM/SIGINT (clean stop, exit code 0) or a
|
||||
broker `exit` request (exit code 75, so the loop starts the newest version).
|
||||
Create the world first (`init`), then run the loop:
|
||||
`--headless` (or `SAUSAGE_HEADLESS=1`) turns the console input off: the host
|
||||
never reads stdin, so end of input does not stop the world. It runs until
|
||||
SIGTERM/SIGINT (clean stop, exit code 0) or a broker `exit` request (exit
|
||||
code 75, so the loop starts the newest version). Create the world first
|
||||
(`init`), then pass the flag through the loop:
|
||||
|
||||
```sh
|
||||
nix run git+https://gitea.surma.technology/surma/sausage#loop -- --headless my-world
|
||||
```
|
||||
|
||||
[`examples/systemd/`](examples/systemd/) has a plain systemd unit and a NixOS
|
||||
module that run exactly this.
|
||||
|
||||
In the console:
|
||||
|
||||
```text
|
||||
|
||||
Reference in New Issue
Block a user