systemd: make unit_status read-only (GetUnit only, never LoadUnit)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YShymaPrXmc3KYRUg2HMSs
This commit is contained in:
ariandClaude Sonnet 5.5 committed 2026-10-16 09:30:52 -04:00
1 parent 85af4659f1
commit 74802efd0e
7 files changed
+15 -12

No files matched your search

+1 -1
View File
@@ -98,7 +98,7 @@ Precedence: built-in defaults < `--config /etc/skyg-linux-tracker.toml` < `SKYG_
### Sources (live reads only)
- **systemd** (`sources/systemd.rs`): one shared `zbus::Connection` to the system bus. `list_units()` → `ManagerProxy::list_units()`; `list_timers()` → `list_timers()` (next-elapse realtime converted to RFC3339); `unit_status(name)` → `load_unit` + properties (`ActiveState`, `SubState`, `ExecMainStatus`, `NRestarts`, `ActiveEnterTimestamp`). No caching — every call hits D-Bus.
- **systemd** (`sources/systemd.rs`): one shared `zbus::Connection` to the system bus. `list_units()` → `ManagerProxy::list_units()`; `list_timers()` → `list_timers()` (next-elapse realtime converted to RFC3339); `unit_status(name)` → `get_unit` (read-only, never `load_unit`) + properties (`ActiveState`, `SubState`, `ExecMainStatus`, `NRestarts`, `ActiveEnterTimestamp`). No caching — every call hits D-Bus.
- **journal** (`sources/journal.rs`): `Journal::open()`, `match_add("_SYSTEMD_UNIT", …)`, `seek_tail()`. Snapshot queries seek backward N entries. `follow()` wraps `Journal::wait()` in a `tokio::task::spawn_blocking` bridge (sd-journal is blocking) feeding a `tokio::sync::mpsc` — consumers (SSE endpoint, MCP tool, OTel log exporter) all read from channels.
- **docker** (`sources/docker.rs`): shared `bollard::Docker` over the unix socket. `ps()` → `list_containers` + `inspect_container` per container for `State.Health`, `StartedAt` (→ uptime), restart count. `logs(name, follow)` → `bollard` log stream (`stdout`, `stderr`, `timestamps`, `since`) as a `Stream<Item = LogOutput>`.