feat: add systemd timer for zomboid container stats

Deploy systemd timer that writes zomboid container stats to
zomboid-stats.json every 30 seconds for gregtime to read.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Bastian de Byl
2026-01-22 23:10:05 -05:00
parent 5ac9b2fabe
commit c2d117bd95
4 changed files with 107 additions and 6 deletions

View File

@@ -0,0 +1,6 @@
[Unit]
Description=Write Zomboid container stats to file
[Service]
Type=oneshot
ExecStart={{ podman_home }}/bin/zomboid-stats.sh

View File

@@ -0,0 +1,3 @@
#!/bin/bash
# Write zomboid container stats to file for gregtime to read
podman stats --no-stream --format json zomboid 2>/dev/null > {{ gregtime_path }}/data/zomboid-stats.json || true

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Update Zomboid container stats every 30 seconds
[Timer]
OnBootSec=30s
OnUnitActiveSec=30s
[Install]
WantedBy=timers.target