hyperhive/nix/host-modules
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 9c601c4166 containers: put journal files on the host, where the collector looks
The swarm collector reads /var/log/journal and has never seen a single
container unit. mara's count-by-unit against VictoriaLogs returns four
units, all host-tier; openbao -- which runs inside the swarm-bao
container -- is absent.

Cause: nixos-containers.nix hardcodes `--link-journal=try-guest` for
every non-ephemeral container. With `guest`, the host's
/var/log/journal/<machine-id> is a SYMLINK into the container's transient
root; a reader in the host namespace cannot follow it, and it dangles as
soon as the container stops. `ls -la /var/log/journal/` on the host shows
one real directory and a pile of `-> /tmp/nspawn-root-*` links dating
back to May.

swarm-otel.nix asserted the opposite, and that assertion is why the
receiver's path was considered sufficient: it said the files "live here"
and are "bind-mounted into the guest rather than the other way round".
That describes `--link-journal=host`. The same sentence names the flag we
actually use. The flag was right and the behaviour it described was not,
so grepping for the flag confirmed the comment and taught nothing.

`containers.<name>.extraFlags` feeds EXTRA_NSPAWN_FLAGS, which the
invocation expands after the hardcoded flag, so `--link-journal=host`
wins. The comment now describes what the code does instead of the other
way round.

Two payoffs, and the smaller one is the one the issue is about:
container logs become collectable, and -- independently -- they become
durable at all, rather than dying with the container.

Ten identical edits because ten host-modules hand-roll their own
container block; that duplication is #3773, not something to invent an
abstraction for here.

NOT VERIFIED: that systemd-nspawn honours the last `--link-journal` of
two. Everything else here is read out of nixpkgs; that step is a claim
about its argument parsing which cannot be exercised without starting a
container. It is settled by deploying one and re-running the `ls`: the
machine-id entry becomes a real directory instead of a symlink.

Refs #3849
2026-09-02 23:00:30 +02:00
..
hive-c0re refs: repoint seven comments that name files which have moved 2026-09-02 08:58:31 +02:00
hive-forge containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
hive-gateway gateway: file nginx error lines at their own severity 2026-09-02 17:56:15 +02:00
lib swarm: extract the name guards, so the module just says what is forbidden 2026-08-31 18:50:15 +02:00
swarm-grafana/dashboards treefmt: apply prettier 2026-09-02 15:25:07 +02:00
default.nix glue-matrix-bao-token: the store's first reader 2026-08-30 19:01:10 +02:00
deploy.nix deploy: move the hive CA's knobs to deploy.hive-controller.tls 2026-08-30 20:52:00 +02:00
glue-bao-tls.nix swarm-bao: ship the store's logs and metrics 2026-08-31 21:25:00 +02:00
glue-matrix-bao-token.nix swarm-bao: ship the store's logs and metrics 2026-08-31 21:25:00 +02:00
hive-ci.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
hive-matrix.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
hive-network.nix docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
hive-priv.nix docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
hive-tls.nix docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
hyperhive.nix docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
local-defaults.nix deploy: rename enableAllLocalDefaults to deploy.singleHostSwarm 2026-08-30 20:12:16 +02:00
otel.nix deploy: move the hive CA's knobs to deploy.hive-controller.tls 2026-08-30 20:52:00 +02:00
stylix-theme.nix swarm-ui: apply the operator's stylix theme, same as the dashboard already does 2026-08-24 14:28:25 +02:00
swarm-authelia.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-bao.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-ca.nix swarm-ca: state the store-is-world-readable rule once, not three times 2026-09-02 09:03:35 +02:00
swarm-container-resolver.nix fix(#3363): swarm containers write their own resolver file 2026-08-17 17:30:15 +02:00
swarm-controller.nix swarm: remove swarm.ui.domain, serve the UI on the swarm domain 2026-08-31 19:00:52 +02:00
swarm-grafana.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-nats.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-otel.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-peers-removed.nix docs+nix: fix stale certFingerprint/HYPERHIVE_PEERS references (hyperhive#3294) 2026-08-15 19:56:11 +02:00
swarm-required-services.nix deploy: rename enableAllLocalDefaults to deploy.singleHostSwarm 2026-08-30 20:12:16 +02:00
swarm-snapshot-store.nix docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
swarm-ui.nix swarm: remove swarm.ui.domain, serve the UI on the swarm domain 2026-08-31 19:00:52 +02:00
swarm-victorialogs.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-victoriametrics.nix containers: put journal files on the host, where the collector looks 2026-09-02 23:00:30 +02:00
swarm-wireguard.nix docs+nix: fix stale certFingerprint/HYPERHIVE_PEERS references (hyperhive#3294) 2026-08-15 19:56:11 +02:00
swarm.nix swarm: remove swarm.ui.domain, serve the UI on the swarm domain 2026-08-31 19:00:52 +02:00