mod_systemd: Implement watchdog support - #728
Closed
notroj wants to merge 1 commit into
Closed
Conversation
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.