diff --git a/src/daemon/systemd-hints.test.ts b/src/daemon/systemd-hints.test.ts index 9d7621bd798..529bd1409c5 100644 --- a/src/daemon/systemd-hints.test.ts +++ b/src/daemon/systemd-hints.test.ts @@ -28,6 +28,8 @@ describe("renderSystemdUnavailableHints", () => { it("renders generic Linux recovery hints outside WSL", () => { expect(renderSystemdUnavailableHints()).toEqual([ "systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.", + "On a headless server (SSH/no desktop session): run `loginctl enable-linger` to persist your systemd user session across logins.", + "Also ensure XDG_RUNTIME_DIR is set: `export XDG_RUNTIME_DIR=/run/user/$(id -u)`, then retry.", `If you're in a container, run the gateway in the foreground instead of \`${formatCliCommand("openclaw gateway")}\`.`, ]); }); diff --git a/src/daemon/systemd-hints.ts b/src/daemon/systemd-hints.ts index 49cd2a9016d..5709207503a 100644 --- a/src/daemon/systemd-hints.ts +++ b/src/daemon/systemd-hints.ts @@ -24,6 +24,8 @@ export function renderSystemdUnavailableHints(options: { wsl?: boolean } = {}): } return [ "systemd user services are unavailable; install/enable systemd or run the gateway under your supervisor.", + "On a headless server (SSH/no desktop session): run `loginctl enable-linger` to persist your systemd user session across logins.", + "Also ensure XDG_RUNTIME_DIR is set: `export XDG_RUNTIME_DIR=/run/user/$(id -u)`, then retry.", `If you're in a container, run the gateway in the foreground instead of \`${formatCliCommand("openclaw gateway")}\`.`, ]; }