Repository navigation
feat(init): lower wait_for in all three init templates - #421
Merged
Merged
Conversation
The charly (template-data) leg that makes wait_for actually hold a service back.
spec#60 made it authorable and carried it; plugin-init#4 built the lowering; until
the templates call it, a declared wait_for did nothing at all.
Each init lowers it in its own idiom, which is the point - the wait is SUPERVISED,
so a timeout fails the unit and surfaces in its status instead of a wrapper exiting
and looking like the daemon crashed:
systemd ExecStartPre=/bin/sh -c '<wait>' ahead of the authored
exec_start_pre hooks, because readiness is a precondition of those
hooks too
supervisord command=/bin/sh -c '<wait>; exec <original>' - supervisord has no
pre-exec, so the wait runs in the same process and `exec` hands the
PID to the real daemon, keeping supervisord's process tracking and
signal delivery intact
openrc start_pre() { <wait>; }
A service that declares no wait_for renders byte-identically: every branch is
inside {{if}}, and waitForScript returns "" for nil.
Proven live on a disposable bed, and the bed is DISCRIMINATING rather than
decorative: `waiter` refuses to run when its socket is absent and declares
start_retry: 0, so a premature start is permanent. `late-socket` creates the
socket only after 8 seconds. Reaching RUNNING is therefore possible only because
the declared wait held the start back:
PASS the waiter refuses to start without the socket, which is what makes the
bed discriminating
PASS the supervisord fragment lowers wait_for into a pre-exec ahead of the
command
PASS the service that waits for a late socket reached RUNNING
check run check-wait-for-pod: PASS (steps=13)
Pins move to spec v0.2026240.1719 and plugin-init v0.2026240.1727.
TestEmbeddedVocab_OpenRCIsAFirstClassInit gains its third stub. Stubbed, not
reimplemented: the lowering is owned by candy/plugin-init and pinned by its
TestWaitForScript, and a second copy here could drift from the one the renderer
uses.
Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)
Claude-Session: https://claude.ai/code/session_01Gf42A3bau77JigFYLALrnq
Contributor
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all 4 files accounted for in the body), no secrets/exfiltration, no weakened guardrails, no suspicious supply-chain changes (both pins bump to same-day merged/tagged releases, consistent across go.mod/go.sum). Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
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.
Summary
The charly (template-data) leg that makes
wait_foractually hold a service back — and the lastpiece of batch B2.
spec#60made it authorable and carried it;plugin-init#4built thelowering; until the templates call it, a declared
wait_fordid nothing at all.Each init lowers it in its own idiom:
ExecStartPre=/bin/sh -c '<wait>', ahead of the authoredexec_start_prehookscommand=/bin/sh -c '<wait>; exec <original>'start_pre() { <wait>; }Two of those placements are load-bearing rather than stylistic:
execin the same process — supervisord has no pre-exec, so the wait runs inlineand
exechands the PID to the real daemon. Withoutexec, supervisord would track the shell,and its process supervision and signal delivery would both target the wrong process.
A service declaring no
wait_forrenders byte-identically: every branch sits inside{{if}},and
waitForScriptreturns""for nil.How tested
Live, on a bed built to fail without this
The bed is discriminating, not decorative:
waiterrefuses to run when/tmp/late.sockis absent, and declaresstart_retry: 0, so apremature start is permanent — not retried into a false pass.
late-socketcreates that socket only after 8 seconds.So reaching
RUNNINGis possible only because the declared wait held the start back:Re-run from the committed tree with the binary rebuilt from the final commit — same result,
including the
updatedestroy-and-rebuild leg.The systemd rendering
That is
pod-labwc/labwc-wrapper's loop as a declaration — with the timeout it declares actuallyhonoured. The wrapper says
TIMEOUT=30and waits 15.Module gates
Pins
spec→v0.2026240.1719,plugin-init/candy/plugin-init→v0.2026240.1727. Both merged andtagged.
A third stub, same reasoning
TestEmbeddedVocab_OpenRCIsAFirstClassInitparses the OpenRC template with an explicit func map;waitForScriptis the third custom function to appear there. Stubbed, not reimplemented — thelowering is owned by
candy/plugin-initand pinned by itsTestWaitForScript; a second copy herecould drift from the one the renderer uses.
Rulebook compliance
/charly-image:layerand/charly-check:checkloaded before editing.handled the same way.
plugin-init, not thrice intemplates.
and hardcoded timeouts.
git statuschecked; branch off freshmain; no force-push, no bypass.coverage that fails without the change by construction.
and the systemd unit text is pasted.
task build:binaryoutput.Change classification
disposable bed that fails without the change.
fully tested and validated— for the supervisord path, which is whatthe bed deploys: the changed branch executes live and the bed cannot pass without it. See
Not covered for the honest limit.
Not covered
so
ExecStartPre=andstart_pre()are asserted at the artifact level only. That is the same gapthe cstream VM bed exists to close, and it is why the tier above is scoped to supervisord rather
than claimed across all three.
waybar, waybar-labwc, sway) is its own unit. Their honest gate is
check-selkies-labwc-podandfriends staying green while the loops are deleted — beds that build pixelflux from source and
Chrome from the AUR. Bundling an unrunnable gate here would make this cutover unprovable;
pod-labwc's 30-vs-15 timeout is that unit's first fix.Assisted-by: Claude Code Anthropic Opus 5 (fully tested and validated)