Skip to content

fix(agent-proxy): emit systemd path directives unquoted - #71

Merged
smsunarto merged 2 commits into
mainfrom
poteto/agent-proxy-systemd-unit-quotes
Aug 25, 2026
Merged

fix(agent-proxy): emit systemd path directives unquoted#71
smsunarto merged 2 commits into
mainfrom
poteto/agent-proxy-systemd-unit-quotes

Conversation

@smsunarto

@smsunarto smsunarto commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Fixes #66.

bb agent-proxy install on Linux wrote a unit whose WorkingDirectory=, StandardOutput=, and StandardError= values were quoted. systemd only defines quoting for command lines such as ExecStart=. A quoted WorkingDirectory= is a fatal unit error, so the service never loaded. Quoted output directives were silently ignored, which sent core logs to the journal instead of core.log.

The fix splits the escaper. systemdValue keeps the control-char guard and % -> %% specifier escaping with no quotes, and now serves the three plain assignments. systemdQuote composes on top of it and still serves ExecStart= words.

Verified in an Ubuntu 24.04 / systemd 255 container: the unit generated before the fix reproduces the reported WorkingDirectory= path is not absolute fatal error under systemd-analyze verify. After the fix, verify exits 0 and a live start under systemd as PID1 reaches active, runs in the right working directory, and appends to core.log. Spaced and percent paths also verify clean.

The first commit lands the failing test, the second the fix plus a patch changeset.


Open in Devin Review

systemd only defines quoting for command lines such as ExecStart=.
A quoted WorkingDirectory= is a fatal unit error on Linux, and quoted
StandardOutput=/StandardError= values are silently ignored, so the
service never loaded and logs went to the journal. Keep %-specifier
escaping, drop the quotes for plain assignment values. Fixes #66.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@smsunarto
smsunarto merged commit ca25205 into main Aug 25, 2026
4 checks passed
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.

agent-proxy: generated systemd unit quotes WorkingDirectory= so the service never loads on Linux

1 participant