← Back to PRs

#13014: feat(infra): add systemd WatchdogSec integration

by TGambit65 open 2026-02-10 02:02 View on GitHub →
docs gateway size: S
Implements systemd WatchdogSec and Type=notify integration for OpenClaw. This allows systemd to monitor the gateway health and automatically restart it if it hangs. Referencing GitHub Discussion #12026. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR adds systemd `Type=notify` / `WatchdogSec` integration by introducing `src/infra/systemd-notify.ts` (READY/WATCHDOG notifications via `NOTIFY_SOCKET`) and wiring it into gateway startup (`notifyReady()` in `src/gateway/server.impl.ts`) and the existing maintenance tick loop (`notifyWatchdog()` in `src/gateway/server-maintenance.ts`). It also adds docs with a sample unit file and new Vitest coverage. Before merging, the new tests need to be made runnable: `src/infra/crypto-store.test.ts` currently imports a non-existent `./crypto-store.js`, and `src/infra/systemd-notify.ts` includes an unused `node:fs` import that is likely to trip CI lint/typecheck rules. <h3>Confidence Score: 2/5</h3> - This PR is not safe to merge as-is because CI is likely to fail due to a broken test import and an unused import. - Core feature wiring is small and localized, but the added `crypto-store.test.ts` references a missing module (`./crypto-store.js`), which will fail module resolution, and `systemd-notify.ts` has an unused `fs` import that may fail lint/typecheck. Fixing these should make the PR much lower risk. - src/infra/crypto-store.test.ts, src/infra/systemd-notify.ts <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs