fix(systemd): use systemd-notify + NotifyAccess=all for watchdog

unix_dgram to NOTIFY_SOCKET failed on rk3528 (embedded Node), so WATCHDOG=1 never
reached systemd despite WATCHDOG_USEC fallback. Switch to exec systemd-notify with
NOTIFY_SOCKET in child env; unit sets NotifyAccess=all so cgroup may notify.

Users must reload unit (re-run install.sh or add NotifyAccess=all manually).

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-28 14:54:56 +08:00
parent fdc1e9fbd3
commit 06d06fdd1e
2 changed files with 22 additions and 31 deletions

View File

@@ -188,6 +188,8 @@ Wants=NetworkManager.service
[Service]
Type=simple
# systemd-notify 由子进程执行,默认 NotifyAccess=main 会拒收;需 all 才能喂 WatchdogSec
NotifyAccess=all
EnvironmentFile=$ENV_FILE
ExecStart=$NODE_BIN $INSTALL_DIR/bin/clawd.js
WorkingDirectory=$INSTALL_DIR