Log Monitor Loop Fills Disk
A monitor that should protect the host can become the outage when it busy-polls log files, repeats the same error thousands of times per second, and fills syslog or journald before anyone sees the original permission or file-descriptor problem.
Ask free AI judgment
Find what you can delete.
Leave your email now. The scan summary can follow after the first reply; we send the free SafeDisk AI deletion trial step only if deletion risk is still unclear.
Runbook: Stop The Flood Without Hiding The Root Error
- Preserve the first few error lines. The repeated line that fills disk may be a symptom of an earlier permission, fd limit, or missing file state.
- Put a temporary blast-radius cap in place: journald or rsyslog max use, service CPU quota, and rate limiting. This is containment, not the final fix.
- Fix the loop: use inotify or a sleep-backed poll interval, keep a file offset, and avoid reopening/re-reading from byte zero on every iteration.
- Add error backoff: 1s, 2s, 4s up to a cap, plus "repeated N times" aggregation instead of one log line per failed loop.
- Bound resource spikes: file descriptor limit, concurrent lookups, and a disable-after-K-failures path for unreadable monitored files.
- Turn the incident into a policy: max log bytes/minute, max repeated errors/minute, alert when /var reserve is breached, and documented service permissions.
Copy-ready issue reply
Use this when a monitor fills disk with repeated errors.
This separates containment from the real product fix: sleep/inotify, offset tracking, rate-limited logging, and permission-safe packaging.
I would split this into containment and the loop fix.
Read-only evidence before cleanup:
SERVICE=<service-name>
df -h / /var /var/log 2>/dev/null
df -i / /var /var/log 2>/dev/null
du -sh /var/log /var/log/journal 2>/dev/null
journalctl -u "$SERVICE" -n 300 --no-pager 2>/dev/null || true
systemctl show "$SERVICE" -p MainPID -p Restart -p RestartUSec -p LimitNOFILE 2>/dev/null || true
For the fix, I would require three guards: no tight poll loop (inotify or sleep + last-byte offset), rate-limited recurring errors with exponential backoff, and a bounded log/journal budget so a permission error cannot become a disk-full outage.
Do Not Delete First
- The first logs that show the original permission, fd limit, or missing file error.
- All logs before summarizing repeated signatures, timestamps, and growth rate.
- Systemd unit files or security settings before recording current capabilities, groups, and limits.
- Application databases or service state just because /var is full; contain the log flood first.
Free AI deletion trial
Need a delete / confirm / protect answer?
Send the issue link, log excerpt, or storage summary first. We reply with the next safe move and offer the free SafeDisk AI deletion trial only if the incident still needs review.