Skip to content

Read the kit commit as root in the reconcile check too, and do not re-arm a running setup - #127

Merged
solutionphil merged 1 commit into
alphafrom
reconcile-once
Sep 5, 2026
Merged

solutionphil merged 1 commit into
alphafrom
reconcile-once

Conversation

@solutionphil

Copy link
Copy Markdown
Owner

Symptom: since 2026-09-03 every boot is a slow boot: Moonraker needs 46 s instead of 19 s to initialise and the display arrives 30–40 s late.

Root cause: since #114 ensure-imageid.sh calls apply-reconcile-check.sh as root before every klipper start. Its plain git -C … rev-parse HEAD is refused by root (no HOME, clone owned by the printer user, dubious ownership), so the fallback reads the flat .kit-commit baked into the image, 5d1efdfa from 15.08. on the dev printer, which never moves. The stamp can never match, the marker is armed on every start, and the full optimize-boot.sh run comes with it: 56 runs in arco-reconcile.log by today, three for one and the same kit commit within twenty minutes on a printer that had not changed.

Second defect, same file: the check runs twice per start, as root from drop-in 19, which starts the setup at once, and as the owner from drop-in 25 a few seconds later while that run is still going and the stamp not yet written. Re-arming there bought a second full run on the next start; most commits appear twice in the log.

Change: -c safe.directory='*' on the git call, the same way optimize-boot.sh already reads the commit where it writes the stamp; with .git present the flat file is never consulted again; and no arming while arco-reconcile.service is active.

Checks: bash -n, ShellCheck error-severity clean. Verified on the dev printer: .kit-commit = 5d1efdfa, HEAD = 5270fe1, stamp rewritten on three consecutive boots without a kit change.

🤖 Generated with Claude Code

…-arm a running setup

Since #114 ensure-imageid.sh calls apply-reconcile-check.sh as root, before every klipper start.
That script compared the kit's HEAD against the stamp with a plain `git -C`, which root, with no
HOME and against a clone owned by the printer user, refuses as dubious ownership -- so the fallback
answered with the flat .kit-commit baked into the image, a value that never moves. The stamp could
never match, the marker was armed on every start, and the full optimize-boot.sh run (about 60 s,
22 daemon-reloads) came with it: 56 runs in the reconcile log by 2026-09-05, three of them for one
and the same kit commit within twenty minutes, on a printer that had not changed. Measured on the
dev printer: Moonraker needing 46 s instead of 19 s to initialise and the display arriving 30-40 s
late, every boot, since 2026-09-03. `-c safe.directory='*'` on the command line fixes it regardless
of HOME, the same way optimize-boot.sh already reads the commit where it writes the stamp; and with
.git present the flat file is never consulted again.

Second, the same check runs twice per start: as root from drop-in 19, which starts the setup at
once, and as the owner from drop-in 25 a few seconds later, while that run is still going and the
stamp not yet written. Re-arming there bought a second full run on the next start, which is why
most commits appear twice in the log. It now leaves an active arco-reconcile alone.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@solutionphil
solutionphil merged commit 05231ae into alpha Sep 5, 2026
5 checks passed
@solutionphil
solutionphil deleted the reconcile-once branch September 5, 2026 08:29
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