-
Notifications
You must be signed in to change notification settings - Fork 5
fix(update_validation): poll system health instead of broken state wait #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
JanZachmann
merged 25 commits into
omnect:main
from
JanZachmann:jz-2026-07-28-wait-for-system-healthy
Jul 31, 2026
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a29f79f
feat(systemd): rate system health incl. crash-loop detection
JanZachmann 0170c77
fix(update_validation): poll system health instead of broken state wait
JanZachmann 75caef3
feat(healthcheck): rate crash-looping services as red
JanZachmann c0d49c5
fix(healthcheck): rate failed service listing as red
JanZachmann dc9281a
chore: document system health validation; bump to 0.45.0
JanZachmann 1248f3c
docs: correct crash-loop wording
JanZachmann b9f18de
fix(update_validation): flag crash loops by restart count only
JanZachmann 523e7fb
fix(healthcheck): address review findings
JanZachmann be42145
fix(update_validation): derive health deadline from remaining time
JanZachmann 8e267a4
fix(healthcheck): rate only a live crash loop red
JanZachmann a086e99
revert(healthcheck): keep the double underscore in check script names
JanZachmann c6e07bd
fix(update_validation): do not confirm health while a restart is pending
JanZachmann 3db1212
fix(update_validation): reject a crash loop threshold of 0
JanZachmann 4ec4b2e
fix(update_validation): confirm an unhealthy verdict before rolling back
JanZachmann b31c1bb
fix(update_validation): decide the deadline by all observations
JanZachmann 9029c26
fix(update_validation): tolerate a transient system health poll error
JanZachmann 4b6a329
fix(update_validation): rate only an auto-restart cycle as a pending …
JanZachmann 2367e7a
test(systemd): restore the crash loop threshold env var on a panic
JanZachmann f9ee5cc
fix(update_validation): read the unit states as strings
JanZachmann 7038345
fix(update_validation): let a healthy observation count at the deadline
JanZachmann 7e97bc7
fix(update_validation): keep the poll error cause in the reboot reason
JanZachmann ace715e
fix(update_validation): report the cause seen most often
JanZachmann e792625
fix(healthcheck): rate a queued restart as a crash loop too
JanZachmann fb6ec7c
docs(update_validation): describe the deadline rules as they are now
JanZachmann 5e476fd
docs(update_validation): record the cause tie-break and the failed po…
JanZachmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/bin/sh | ||
| # | ||
|
|
||
| . healthchecklib.sh | ||
|
|
||
| # prints crash-looping services to stdout; returns 1 if they cannot be determined | ||
| function find_crash_loops() { | ||
|
HarryWaschkeit marked this conversation as resolved.
|
||
| local unit props active sub found="" units | ||
|
|
||
| units=$(systemctl list-units --all --type=service --no-legend --plain | awk '{print $1}') | ||
| if [ -z "${units}" ]; then | ||
| return 1 | ||
| fi | ||
|
JoergZeidler marked this conversation as resolved.
|
||
|
|
||
| for unit in ${units}; do | ||
| props=$(systemctl show "${unit}" -p ActiveState,SubState 2>/dev/null) || continue | ||
| active=$(echo "${props}" | sed -n 's/^ActiveState=//p') | ||
| sub=$(echo "${props}" | sed -n 's/^SubState=//p') | ||
|
|
||
| # only a live loop is rated red: NRestarts has no time window and keeps | ||
| # counting occasional restarts, and a unit that gave up restarting shows | ||
| # up as a failed unit in the system-running check | ||
| if [ "${active}" = "activating" ]; then | ||
| case "${sub}" in | ||
| # 'auto-restart-queued' is the same pending restart with the | ||
| # restart job already queued | ||
| auto-restart|auto-restart-queued) | ||
| found="${found} ${unit}(${sub})" | ||
| ;; | ||
| esac | ||
| fi | ||
| done | ||
|
|
||
| echo "${found}" | ||
| } | ||
|
|
||
| function do_check() { | ||
| local found rating=0 | ||
|
|
||
| found=$(find_crash_loops) || rating=2 | ||
| [ -z "${found}" ] || rating=2 | ||
| print_rating ${rating} crash_loop "$ME" | ||
| do_rate ${rating} | ||
| return ${rating} | ||
| } | ||
|
|
||
| function do_get_infos() { | ||
| local found rating=0 error="" | ||
|
|
||
| found=$(find_crash_loops) || { rating=2; error="failed to list services"; } | ||
| [ -z "${found}" ] || rating=2 | ||
| print_info_header "${ME}" "${rating}" | ||
| [ -z "${error}" ] || echo "${error}" | ||
| [ -z "${found}" ] || echo "crash-looping services:${found}" | ||
| return ${rating} | ||
| } | ||
|
|
||
| command="${1:-check}" | ||
| [ "$1" ] && shift | ||
| check_command_arg "$command" | ||
|
|
||
| case "$command" in | ||
| check) | ||
| do_check "$@" | ||
| retval=$? | ||
| ;; | ||
| get-infos) | ||
| do_get_infos "$@" | ||
| retval=$? | ||
| ;; | ||
| esac | ||
|
|
||
| exit $retval | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.