Add recorder: raw CAN and GNSS sessions with failsafes and a storage bound

Reads SocketCAN and gpsd directly. Sessions start on the first frame or on
'ctl start', end after 15 s of bus idle or on 'ctl stop'; blips under 3 s are
discarded. candump -L chunks fdatasync'd every second and zstd'd once closed;
oldest sessions deleted to stay under 50 GB / above 20 GB free. Kernel and
queue drops, link changes and clock steps are recorded as events.

Bench-tested on vcan with the first car capture (byte-identical) and installed
on the car Orin as yukart-recorder.service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
This commit is contained in:
2026-10-09 20:15:13 +09:00
commit 1f678fe87f
19 changed files with 1784 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
[Unit]
Description=Yukart recorder: raw CAN and GNSS sessions to disk
Documentation=gitea:yukart/svc-core
# Tier 1, ordered after nothing: CAN adapter and gpsd come and go, and the
# recorder waits for them itself rather than through unit dependencies.
StartLimitIntervalSec=0
[Service]
User=mikkeli
ExecStart=/usr/local/bin/yukart-recorder run
Restart=always
RestartSec=2
# /var/lib/yukart/recordings and /run/yukart-recorder, created and chowned by systemd.
StateDirectory=yukart/recordings
RuntimeDirectory=yukart-recorder
# Shutdown closes the session and fsyncs; seconds at most, but never cut it short.
TimeoutStopSec=20
KillSignal=SIGTERM
Nice=-5
IOSchedulingClass=best-effort
IOSchedulingPriority=0
[Install]
WantedBy=multi-user.target