From 394d1463c367bfa68e16fe27094e18d745b7148b Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 24 Jun 2026 23:18:00 +0300 Subject: [PATCH] =?UTF-8?q?feat(v0.3):=20watchdog-=D0=BA=D0=BE=D0=BD=D1=84?= =?UTF-8?q?=D0=B8=D0=B3=20(B05/A14)=20+=20save-time=20timer=20(B07)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit P7.3: watchdog-shturman.conf (system.conf.d: RuntimeWatchdogSec/RebootWatchdogSec — дисциплина; реальный /dev/watchdog + MCU-backstop — HW/v0.4). shturman-savetime.service/ .timer — periodic fake-hwclock save в /data (~5 мин). Co-Authored-By: Claude Opus 4.8 Signed-off-by: Alexander --- systemd/shturman-savetime.service | 9 +++++++++ systemd/shturman-savetime.timer | 9 +++++++++ systemd/watchdog-shturman.conf | 6 ++++++ 3 files changed, 24 insertions(+) create mode 100644 systemd/shturman-savetime.service create mode 100644 systemd/shturman-savetime.timer create mode 100644 systemd/watchdog-shturman.conf diff --git a/systemd/shturman-savetime.service b/systemd/shturman-savetime.service new file mode 100644 index 0000000..d427318 --- /dev/null +++ b/systemd/shturman-savetime.service @@ -0,0 +1,9 @@ +[Unit] +Description=Штурман save last-known-time (fake-hwclock → /data, B07) +After=data.mount +Requires=data.mount + +[Service] +Type=oneshot +# FILE из /etc/default/fake-hwclock (→ /data; v0.6). Сервис fake-hwclock в Lima masked → зовём напрямую с env. +ExecStart=/bin/sh -c '. /etc/default/fake-hwclock 2>/dev/null; FILE="${FILE:-/data/state/fake-hwclock.data}" fake-hwclock save' diff --git a/systemd/shturman-savetime.timer b/systemd/shturman-savetime.timer new file mode 100644 index 0000000..f78568f --- /dev/null +++ b/systemd/shturman-savetime.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Штурман periodic save-time (B07) + +[Timer] +OnBootSec=2min +OnUnitActiveSec=5min + +[Install] +WantedBy=shturman-stage2.target diff --git a/systemd/watchdog-shturman.conf b/systemd/watchdog-shturman.conf new file mode 100644 index 0000000..6c08619 --- /dev/null +++ b/systemd/watchdog-shturman.conf @@ -0,0 +1,6 @@ +# Watchdog (B05/A14): systemd пингует HW-watchdog в runtime + дедлайн на shutdown-фазу. +# Установка: /etc/systemd/system.conf.d/shturman-watchdog.conf. В VM /dev/watchdog нет → дисциплина +# (реальный HW-арминг + MCU-backstop — v0.4, VM↔HW-граница как zram/vcan в v0.6). +[Manager] +RuntimeWatchdogSec=30s +RebootWatchdogSec=60s