pkg-cache: CT130 self-check timer (fail fast when the cache is broken) #67

Merged
jknapp merged 2 commits from feat/pkg-cache-selfcheck-ct130 into trunk 2026-11-29 15:32:27 +00:00
2 Commits
Author SHA1 Message Date
shadowdaoandClaude Sonnet 5.5 bd685f72fb pkg-cache selfcheck: re-check nginx started by something else while stopped; fix test fake is-active
The marker branch left a manually/otherwise restarted nginx running unchecked
while the disks were still bad. Now a running nginx with our marker present is
judged like normal operation (stopped again if unhealthy). The test systemctl
fake always returned 0 for is-active, hiding the admin-stopped branch; fixed,
and the tests now pin PKGCACHE_SERVICES and cover the empty-list case.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-29 07:30:52 -08:00
shadowdaoandClaude Sonnet 5.5 8107b29e14 feat(pkg-cache): CT130 self-check timer (stop nginx+registry when the cache is unhealthy)
pkg-cache/pkgcache-selfcheck.{sh,service,timer}: every 60 s check rw mounts, write+fsync+delete
and a fresh fetch through nginx; on failure stop nginx + registry so clients fail over to the
origin instantly (connection refused); restart after 3 healthy runs + nginx -t. Never fsck.
Alert = Uptime Kuma monitors 53/54 going DOWN. Deployed on CT130 2026-11-29.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-29 07:23:46 -08:00