Skip to content

Commit 762fed1

Browse files
chocobo9claude
authored andcommitted
fix(daemon): add headless server hints to systemd unavailable error
Add loginctl enable-linger and XDG_RUNTIME_DIR recovery hints to the generic (non-WSL) systemd unavailable error path, helping users on SSH/headless servers diagnose and fix the issue without a desktop session. Fixes #11805 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 2aaea9f commit 762fed1

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎src/daemon/systemd-hints.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ describe("renderSystemdUnavailableHints", () => {
2828
it("renders generic Linux recovery hints outside WSL", () => {
2929
expect(renderSystemdUnavailableHints()).toEqual([
3030
"systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.",
31+
"On a headless server (SSH/no desktop session): run `loginctl enable-linger` to persist your systemd user session across logins.",
32+
"Also ensure XDG_RUNTIME_DIR is set: `export XDG_RUNTIME_DIR=/run/user/$(id -u)`, then retry.",
3133
`If you're in a container, run the gateway in the foreground instead of \`${formatCliCommand("openclaw gateway")}\`.`,
3234
]);
3335
});

‎src/daemon/systemd-hints.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export function renderSystemdUnavailableHints(options: { wsl?: boolean } = {}):
2424
}
2525
return [
2626
"systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.",
27+
"On a headless server (SSH/no desktop session): run `loginctl enable-linger` to persist your systemd user session across logins.",
28+
"Also ensure XDG_RUNTIME_DIR is set: `export XDG_RUNTIME_DIR=/run/user/$(id -u)`, then retry.",
2729
`If you're in a container, run the gateway in the foreground instead of \`${formatCliCommand("openclaw gateway")}\`.`,
2830
];
2931
}

0 commit comments

Comments
 (0)