Fix: DeployComponents leaves __BUN_PATH__ unsubstituted in the pulse launchd plist (EX_CONFIG)#1436
Closed
rrittich wants to merge 1 commit into
Closed
Conversation
The pulse component materializes com.lifeos.pulse.plist but only replaces __HOME__, leaving __BUN_PATH__ literal. launchd then tries to exec a program named '__BUN_PATH__' and the service dies with EX_CONFIG (78) / healthz 000, even though 'bun run pulse.ts' works directly. Substitute __BUN_PATH__ with process.execPath so the managed service actually starts.
Owner
|
Thanks a lot for this, @rrittich — really appreciate you flagging it and taking the time to write the fix. When I went back through the current source, this turns out to already be handled: the BUN_PATH plist substitution is already in current source (via ctx.bun with a resolution fallback), so the EX_CONFIG bug can't occur — thanks for catching the same class of issue. The system has moved a fair bit since you opened this (the PAI → LifeOS rename and a few subsystem rewrites), so the gap you spotted has since been closed independently. Going to close this one out on that basis — but genuinely grateful for the contribution. 🙏 |
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.
Problem
The
pulsecomponent inDeployComponents.tsmaterializes the launchd plist from the templatecom.lifeos.pulse.plist, which contains two placeholders —__HOME__and__BUN_PATH__. But materialization substitutes only__HOME__:__BUN_PATH__is left literal, so the written plist is:launchd can't exec a program literally named
__BUN_PATH__, so the service fails to start andlaunchctl print gui/<uid>/com.lifeos.pulsereportslast exit code = 78 (EX_CONFIG).bun Tools/DeployComponents.ts --apply --components pulsereturnsapplied: truebut the healthz probe returns000— the daemon never runs under launchd, even though it runs fine when invoked directly (bun run pulse.ts).Fix
Also substitute
__BUN_PATH__, using the bun binary running the deploy (process.execPath):Verification
EX_CONFIG;healthz → 000; dashboard unreachable.launchctl printshowsstate = running,last exit code = (never exited);healthz → 200; dashboard200. Same daemon, now execs correctly under launchd.Single line, single file. (The dry-run action message near L151 also only names
__HOME__; happy to update it to mention__BUN_PATH__for accuracy if desired.)