fix(systemd): pet watchdog when WATCHDOG_USEC missing; StartLimitInterval for old systemd

Embedded units may set WatchdogSec but omit WATCHDOG_USEC; SD_NOTIFY_INTERVAL was 0 so no
WATCHDOG=1 was sent and systemd killed the main process after ~60s.

Replace StartLimitIntervalSec with StartLimitInterval= for older systemd (journal warning).

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-28 14:49:07 +08:00
parent 04dd1017bb
commit fdc1e9fbd3
2 changed files with 17 additions and 13 deletions

View File

@@ -195,7 +195,8 @@ WorkingDirectory=$INSTALL_DIR
# 重启策略
Restart=always
RestartSec=5
StartLimitIntervalSec=300
# 旧版 systemd 不认 StartLimitIntervalSec,用 StartLimitInterval=(秒)
StartLimitInterval=300
StartLimitBurst=10
# 优雅停止10s 内 SIGTERM超时 SIGKILL