Skip to content

misc/openclaw: resolve Node from the dependency prefix - #622

Open
vincentkoc wants to merge 3 commits into
freebsd:mainfrom
vincentkoc:fix-openclaw-runtime-prefix
Open

misc/openclaw: resolve Node from the dependency prefix#622
vincentkoc wants to merge 3 commits into
freebsd:mainfrom
vincentkoc:fix-openclaw-runtime-prefix

Conversation

@vincentkoc

Copy link
Copy Markdown

When PREFIX differs from LOCALBASE, the generated OpenClaw entry point looks for Node under the application prefix, and rc.d checks the wrong executable path. This prevents launch or reports a running service as stopped.

Use LOCALBASE for the dependency Node path in both the shebang and rc.d process identity. OpenClaw’s own files and launcher remain under PREFIX. Bump PORTREVISION from 3 to 4. This two-line runtime repair adds no configuration or supervisor behavior.

Stacked on the service account fix in #620, which includes the account instructions in #619. Those changes remain visible until their branches land.

Native FreeBSD before/after proof, attempt 1 at workflow 756089c888bef4a3bac304ddbd939b5501628669, used actual Ports make do-install and apply-slist with a small Node fixture:

  • Default-prefix generated launcher, entry point and rc.d files are byte-identical before and after.
  • The custom-prefix old launcher fails with no Node binary at that prefix; the fixed launcher uses the dependency runtime successfully.
  • Against the same live fixture process, the old rc.d reports stopped, the fixed rc.d reports running and stops it. The child and supervisor exit, and the PID file is removed.

The tested Makefile and rc.d SHA-256 values are e9d5132ec3fce339c87e840b5c8997141f1615aefbbc28db619bd0bf18491f2b and a47b378066b1f23c7e03f876f0e3376aa2696efbe7301079c135af15100ef4ff, matching signed head c501388ab80c762f723f07db9025a0cf94dc8464. This validates generated launcher/service behavior with a fixture; it does not claim a full Gateway or package upgrade test. No permanent CI workflow is added.

Use the account selected by openclaw_user for onboarding, configuration and pairing so rc.d reads the same state. Bump PORTREVISION to ship the corrected install instructions.
Run the gateway as openclaw_user through daemon(8), while keeping the supervising process privileged to remove the PID file from /var/run. Let daemon set the child HOME. Native FreeBSD testing reproduced the old non-root PID cleanup failure; fixed same-order proof remains pending.
Use LOCALBASE for the Node shebang and rc.d process identity while keeping OpenClaw files under PREFIX. This repairs custom-prefix launch and service status/stop without changing default-prefix output. Native before/after fixture proof is pending.
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 18:23
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