- health 'mode' took the 30 s flock and mkdir'd the state dir; a held lock gave an empty
answer, which sync (OFF) read as 'not off' and reverted from the newest backup. mode is
now read-only and lock-free.
- apply's rewrite() truncated repo files in place and revert used cp -a over the file;
both now write a temp file and rename(2), so a concurrent dnf never sees half a file.
- apply/revert take the same lock as the health timer so a health run cannot rewrite
repo files while they edit them.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
- /etc/pkgcache-host.conf setting (PKGCACHE_ENABLED, PKGCACHE_URL, PKGCACHE_CA); no cache
host is built into the tool. sync/apply/revert/status; status shows mode.
- pkgcache-host-health.sh + 5 min timer (installed only while ON): probes repomd.xml and
.asc through the cache, 2 failures -> origin-only (reversible marker lines, atomic
rename under flock), 3 successes -> cache-first. Both-down is not counted.
- scripts/tests/pkgcache-host.test.sh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6