fix(install): don't abort when journald settings are absent - #507
Conversation
Step 13 reads the effective journald config to decide whether persistent storage and a size cap are already set. Both settings are optional and stock Raspberry Pi OS images ship them commented out, so the grep in the journald_cap pipeline exits 1 — under set -Eeuo pipefail that failed the assignment and killed the entire install at line 1748 on every fresh image. Guard the four optional-lookup pipelines with || true so an absent setting reads as empty instead of aborting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YF7Q48EYCCkU1Vs932uDY1
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe installer now handles missing or commented-out journald settings without exiting during initial configuration reads or post-write verification. ChangesJournald configuration read handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The installer now tolerates absent optional journald settings instead of aborting during setup. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
Problem
first_time_install.shdies in Step 13 ("Apply performance optimizations") at line 1748, exit 1, on every fresh Raspberry Pi OS image. Reproduced on a Pi 4 (hdpi) — three consecutive install runs all failed at the identical spot.The journald-persistence block greps the effective journald config for
Storage=andSystemMaxUse=. Both settings are optional and stock images ship them commented out (#SystemMaxUse=), sogrepexits 1. Under the script'sset -Eeuo pipefail, that fails the command-substitution assignment and the ERR trap aborts the whole install.Storage=happens to survive on current Raspberry Pi OS only because the image ships aStorage=volatiledrop-in; theSystemMaxUse=lookup fails on essentially every system that hasn't set an explicit cap.Fix
Guard the four optional-lookup pipelines with
|| trueso an absent setting reads as an empty string instead of aborting:journald_storage=andjournald_cap=assignments (the crash site)journald_now=re-read after writing the drop-incatfallback insidejournald_effective()(fails if neither config path exists)Downstream logic already handles empty values (
[ -n "$journald_cap" ]decides whether to writeSystemMaxUse=64M), so no other changes are needed.Verification
bash -npasses.Storage=volatilepresent,SystemMaxUse=commented) underset -Eeuo pipefailwith an ERR trap: unpatched pipelines fire the trap; patched ones yieldstorage=volatile,cap=""and continue.🤖 Generated with Claude Code
https://claude.ai/code/session_01YF7Q48EYCCkU1Vs932uDY1
Summary by CodeRabbit