-
Notifications
You must be signed in to change notification settings - Fork 960
fix(service): harden stable systemd launcher contracts #2916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,12 +231,14 @@ interrupted package update removed either file, it logs one `installation is inc | |
| stops instead of retrying the same missing executable every five seconds. Reinstall opencodex, then | ||
| run `ocx service repair` to refresh the task with the restored package paths. | ||
|
|
||
| On Linux, the systemd unit invokes the stable `ocx` executable found on `PATH` at install time | ||
| rather than the Bun and CLI paths inside the installed package tree. Version managers such as | ||
| On Linux, the systemd unit invokes the first regular, executable `ocx` file found on `PATH` at | ||
| install time rather than the Bun and CLI paths inside the installed package tree. Version managers such as | ||
| **mise** and **asdf** install into a versioned directory and delete the old one on upgrade, which | ||
| used to leave the unit pointing at files that no longer existed — systemd then restart-looped while | ||
| still reporting the service as installed. A shim path survives the upgrade, so the unit keeps | ||
| resolving. Source checkouts without an `ocx` launcher keep the previous direct Bun + CLI form. | ||
| resolving. Source checkouts without an `ocx` launcher keep the previous direct Bun + CLI form. A | ||
| trusted `OPENCODEX_BUN_PATH` selected before Bun starts is preserved through the shim; package-local | ||
| bundled Bun paths are deliberately rediscovered after upgrades instead of being pinned in the unit. | ||
|
Comment on lines
+234
to
+241
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '221,246p' docs-site/src/content/docs/reference/cli/lifecycle.md
for locale in ja ko ru zh-cn; do
page="docs-site/src/content/docs/${locale}/reference/cli/lifecycle.md"
if [[ -f "$page" ]]; then
echo "===== $page ====="
sed -n '221,246p' "$page"
else
echo "MISSING: $page"
fi
doneRepository: lidge-jun/opencodex Length of output: 5965 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "===== localized lifecycle sections ====="
for locale in ja ko ru zh-cn; do
page="docs-site/src/content/docs/${locale}/reference/cli/lifecycle.md"
echo "===== $page ====="
rg -n -C 8 'Background service|systemd|OPENCODEX_BUN_PATH|ocx service|サービス|служб|서비스|后台服务' "$page" || true
done
echo "===== launcher implementation ====="
rg -n -C 12 'stableLauncherEntry|OPENCODEX_BUN_PATH|systemd|PATH' . -g '*.ts' -g '*.js' -g '*.tsx' -g '*.jsx' -g '*.md' | head -240Repository: lidge-jun/opencodex Length of output: 50377 Sync the Linux service documentation in all localized lifecycle pages. The 🤖 Prompt for AI AgentsSources: Path instructions, Learnings |
||
|
|
||
| Units installed before this change still carry the old versioned paths and cannot migrate | ||
| themselves — once the old executable is deleted, no opencodex code runs to fix it. Run | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document the absolute PATH-entry requirement.
stableLauncherEntryskips every non-absolute PATH entry before it checksocx. The current text says that systemd selects the first regular executableocxonPATH, which includes relative entries such as.. State that the selected file must be in an absolute PATH directory.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents