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
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-29 07:23:46 -08:00
1 parent a971412243
commit 8107b29e14
5 files changed
+236

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=pkg-cache self-check (stop nginx+registry when the cache is unhealthy)
Documentation=file:///usr/local/sbin/pkgcache-selfcheck
After=nginx.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/pkgcache-selfcheck
TimeoutStartSec=120
Nice=5