HAM-113: bound /var/log so log spam can't fill the SD card#73
Open
pbitzer wants to merge 1 commit into
Open
Conversation
When the AGS is down, brokkr's science_ingest floods /var/log with no backoff (HAM-112), filling the SD card (mj42, mj54, now mj05). Bound the damage independent of the source: journald SystemMaxUse cap, maxsize on the rsyslog logrotate stanzas, and an hourly logrotate run so the cap is enforced within the hour. Ships as a unified_install step plus an idempotent fleet-remediation script (scripts/apply_log_bounds.sh) for already-deployed units. E2E-validated on mj05. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 14, 2026
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.
What
Caps
/var/loggrowth so a runaway log source can't fill the SD card — the disk-fill that hit mj42 (2026-04), mj54 (2026-05), and mj05 (2026-07).Three defenses, independent of the spam source:
SystemMaxUse=500Mdrop-in (files/journald-sensor-bounds.conf)maxsize 100Minjected into each/etc/logrotate.d/rsyslogstanza (idempotent; backs up the original to/var/backups/)files/logrotate-hourly.sh→/etc/cron.hourly/mjolnir-logrotate) somaxsizeis enforced within the hour, not once a dayDelivered as both a
unified_installstep (configure_log_boundsinhardware.sh, Phase 4) and an idempotent fleet-remediation script (scripts/apply_log_bounds.sh, with--check) for already-deployed units.Why
Defense-in-depth for HAM-112 (brokkr
science_ingestretries with no backoff). Even after HAM-112 is fixed, this catches any future runaway log source. HAM-112 itself is deferred (modifying brokkr's untested core on the deployed fleet is too risky right now); this PR makes the disk-fill non-fatal in the meantime.Testing
tests/unified/test_log_bounds.py), incl. a realinstall.sh --dry-runthrough Phase 4 asserting the manifest ops.logrotate -dparses clean,/var/logbounded (journal 1.2G→536M), idempotent re-run,--checkreports all present. mj05 is now remediated./etc/logrotate.d/, causing logrotate "duplicate log entry" errors; fixed to/var/backups/with a regression test.Note
The repo's
tests/shell/test_shellcheck.pyis already red on0.4.xunder shellcheck 0.11.0 (pre-existing SC2155/SC2046 in several libs). This PR adds zero new shellcheck warnings.🤖 Generated with Claude Code