OpenClaw Fixes systemd Environment Corruption on Main
Two merged Linux service fixes preserve quoted and backslash-containing values and parse every inline Environment assignment before Gateway startup.
OpenClaw has merged two Linux service fixes for Environment= handling. Generated systemd units could alter or lose values containing a lone backslash or double quote, while inspection of inline assignments could miss values after the first assignment on a line.
This matters anywhere the managed Gateway receives paths, proxy settings, model configuration or secret references through its unit environment. A service can start successfully while consuming different bytes from those the operator configured.
The corrections are on main; identify a containing release or exact revision before changing production.
The two faults
PR #117375 fixes escaping when OpenClaw writes generated systemd units. Upstream reports that five of eight values tested against real systemd arrived incorrectly before the change. A Windows-style path used by a compatibility tool, a regular expression, JSON fragment or quoted argument can all contain characters whose meaning changes across OpenClaw serialization, systemd parsing and process environment delivery.
PR #117484 fixes the read side: a systemd Environment= directive may contain multiple assignments, and OpenClaw must parse all of them when determining the effective service configuration. Reading only the first creates false diagnostics and can make later lifecycle decisions compare against an incomplete environment.
Interpretation: service configuration has two contracts. The writer must preserve bytes into the process, and the inspector must reconstruct the same effective values. Fixing only one leaves operators with either a broken runtime or misleading diagnostics.
Who should prioritise review
Prioritise a containing build if the generated Gateway unit contains:
- values with backslashes or embedded quotes;
- several assignments on one
Environment=line; - paths shared with Windows-oriented tools or network mounts;
- structured JSON-like environment values;
- proxy or CA configuration whose exact value controls reachability; or
- secret references whose corruption can silently select the wrong credential source.
Do not paste actual secret values into an incident report. A byte-preservation test should use synthetic markers with the same character classes.
Safe acceptance test
Use a disposable service name and harmless values:
- record the generated unit and the exact containing OpenClaw revision;
- configure markers containing one backslash, repeated backslashes, one quote, spaces and an empty value;
- include multiple assignments in one supported inline directive;
- ask systemd to verify and load the disposable unit through normal platform controls;
- have a harmless test process report hashes or escaped representations of received values;
- compare every value byte-for-byte with the intended input;
- run OpenClaw’s service inspection and confirm it reconstructs the same assignments; and
- remove the disposable service through supported lifecycle commands.
Do not hand-edit the production generated unit as a permanent workaround: a later install or update may regenerate it. If an urgent temporary correction is unavoidable, preserve the original, document ownership and revalidate after every service operation.
Incident response
If a Gateway has started with unexplained provider, proxy or path failures, compare three layers: intended OpenClaw configuration, systemd’s parsed unit representation and the process environment exposed through a safe local diagnostic. Redact values while preserving character shape or hashes.
Restart only after proving the corrected effective configuration. A successful process launch does not show that credentials, endpoints or paths survived parsing.
Evidence and limits
The official merged PR and commit records supplied by the OpenClaw repository collector establish both faults. The escaping PR reports measurements against real systemd; those upstream results were not independently reproduced by OpenClaw Academy. Direct GitHub extraction and independent search were unavailable during this run.
Bottom line
Generated service configuration must be lossless. OpenClaw main now preserves backslashes and quotes when writing systemd units and reads every inline assignment when inspecting them.
Linux operators should inventory unusual environment values, move to a confirmed containing build through staging and compare the bytes received by the process—not merely the text that appears in the generated unit.
THE RECEIPTS
Claims should survive the click.
Primary links used for this article are listed openly. If the evidence changes, the verification date changes with it.THE OPERATOR BRIEF