headless: register signal handlers synchronously, split tests, drop deployment examples and wording
ci / check (pull_request) Successful in 1m36s
ci / check (push) Successful in 11s

This commit was merged in pull request #2.
This commit is contained in:
Sausage Agent
2026-10-18 15:31:41 +00:00
parent 01a821ab72
commit a72e42a8c9
6 changed files with 44 additions and 84 deletions
+6 -9
View File
@@ -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