Skip to content

mod_systemd: Implement watchdog support - #728

Closed
notroj wants to merge 1 commit into
apache:trunkfrom
notroj:systemd-watchdog
Closed

mod_systemd: Implement watchdog support#728
notroj wants to merge 1 commit into
apache:trunkfrom
notroj:systemd-watchdog

Conversation

@notroj

@notroj notroj commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

A unit setting WatchdogSec= must send WATCHDOG=1 more often than the
timeout or systemd kills the service; mod_systemd never did, so such a
unit was killed and, with Restart=, restarted in a loop.

The keep-alive goes out from the monitor hook, and with the notifications
either side of a configuration load: the parent reads its configuration
outside the monitor loop, and systemd keeps the timeout armed during a
reload.

The monitor hook runs about every ten seconds and there is no more frequent
hook in the parent, so the shortest WatchdogSec which can be met is 20s.
A shorter one warns (AH10621) rather than leaving a healthy server to be
killed with nothing in the log to explain it.

* modules/arch/unix/mod_systemd.c (watchdog_ping): New.
  (systemd_pre_config, systemd_post_config, systemd_monitor): Send the
  watchdog keep-alive, and warn (AH10621) if WatchdogSec is too short
  to be met.

* docs/manual/mod/mod_systemd.xml: Document watchdog support.

* test/modules/arch/linux/test_006_watchdog.py: New test suite.

* test/modules/arch/linux/env.py (ForegroundServer): New, running httpd
  in the foreground so $WATCHDOG_PID can name it.
  (TransientService): Take extra unit properties.

* test/modules/arch/linux/test_001_notify.py
  (test_systemd_001_09_watchdog): No longer xfail; use a WatchdogSec
  which does not draw AH10621.

* test/modules/arch/linux/README: Describe the watchdog tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@notroj
notroj deleted the systemd-watchdog branch August 30, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant