Skip to content

fix(install): don't abort when journald settings are absent - #507

Merged
ChuckBuilds merged 1 commit into
mainfrom
fix/install-journald-grep-pipefail
Aug 29, 2026
Merged

fix(install): don't abort when journald settings are absent#507
ChuckBuilds merged 1 commit into
mainfrom
fix/install-journald-grep-pipefail

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Problem

first_time_install.sh dies 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= and SystemMaxUse=. Both settings are optional and stock images ship them commented out (#SystemMaxUse=), so grep exits 1. Under the script's set -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 a Storage=volatile drop-in; the SystemMaxUse= lookup fails on essentially every system that hasn't set an explicit cap.

Fix

Guard the four optional-lookup pipelines with || true so an absent setting reads as an empty string instead of aborting:

  • journald_storage= and journald_cap= assignments (the crash site)
  • the journald_now= re-read after writing the drop-in
  • the cat fallback inside journald_effective() (fails if neither config path exists)

Downstream logic already handles empty values ([ -n "$journald_cap" ] decides whether to write SystemMaxUse=64M), so no other changes are needed.

Verification

  • bash -n passes.
  • Reproduced the failing input (Storage=volatile present, SystemMaxUse= commented) under set -Eeuo pipefail with an ERR trap: unpatched pipelines fire the trap; patched ones yield storage=volatile, cap="" and continue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YF7Q48EYCCkU1Vs932uDY1

Summary by CodeRabbit

  • Bug Fixes
    • Improved installation reliability when journald configuration settings are missing or commented out.
    • Prevented valid installations from stopping unexpectedly while reading or verifying journald settings.

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
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: edc7452a-7376-4af8-adae-b0ac0a181b54

📥 Commits

Reviewing files that changed from the base of the PR and between eae0637 and 732a0c6.

📒 Files selected for processing (1)
  • first_time_install.sh

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The installer now handles missing or commented-out journald settings without exiting during initial configuration reads or post-write verification.

Changes

Journald configuration read handling

Layer / File(s) Summary
Tolerate absent journald settings
first_time_install.sh
The journald fallback read and setting-extraction pipelines now continue when Storage= or SystemMaxUse= is missing. Post-write verification also returns an empty value when Storage= is unset.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 732a0

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preventing installation from aborting when journald settings are absent.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/install-journald-grep-pipefail

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds
ChuckBuilds merged commit 4aeb003 into main Aug 29, 2026
9 checks passed
@ChuckBuilds
ChuckBuilds deleted the fix/install-journald-grep-pipefail branch August 29, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant