Skip to content

fix(daemon): add headless server hints to systemd unavailable error#54062

Merged
steipete merged 1 commit intoopenclaw:mainfrom
chocobo9:fix/systemd-headless-hints
Mar 25, 2026
Merged

fix(daemon): add headless server hints to systemd unavailable error#54062
steipete merged 1 commit intoopenclaw:mainfrom
chocobo9:fix/systemd-headless-hints

Conversation

@chocobo9
Copy link
Copy Markdown
Contributor

Summary

  • Adds loginctl enable-linger and XDG_RUNTIME_DIR recovery hints to the non-WSL systemd unavailable error path in renderSystemdUnavailableHints
  • Users on headless/SSH servers now see actionable steps instead of the generic "install/enable systemd" message
  • Updates the snapshot test to match the new hint lines

Changes

src/daemon/systemd-hints.ts

+ "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.",

Test plan

  • pnpm test src/daemon/systemd-hints.test.ts passes
  • Verify on a headless Linux server: openclaw gateway status shows the new hints when systemd user services are unavailable

Fixes #11805

🤖 Generated with Claude Code

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 openclaw#11805

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle bot added gateway Gateway runtime size: XS labels Mar 24, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR adds two actionable recovery hints to the non-WSL systemd-unavailable error path, specifically targeting headless/SSH server users who previously only saw the generic "install/enable systemd" message. The changes are minimal and well-scoped.

  • Adds loginctl enable-linger hint to persist the systemd user session across logins on headless servers
  • Adds export XDG_RUNTIME_DIR=/run/user/$(id -u) hint for environments where the runtime directory is not set by PAM (common in SSH-only sessions)
  • Snapshot test is correctly updated to match the expanded hint array
  • Both hints are technically accurate Linux advice and are clearly labeled with context ("On a headless server...") so they do not confuse desktop or container users who also see the message

Confidence Score: 5/5

  • Safe to merge — purely additive change to a string array with a matching test update, no logic or behavior regressions possible.
  • The change touches only user-facing hint strings in a single function branch and its snapshot test. Both new hints are technically correct Linux advice. No branching logic, no data handling, and no external dependencies are modified. The test is properly updated and passes.
  • No files require special attention.

Reviews (1): Last reviewed commit: "fix(daemon): add headless server hints t..." | Re-trigger Greptile

@steipete steipete merged commit 762fed1 into openclaw:main Mar 25, 2026
42 of 43 checks passed
@steipete
Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm check && pnpm build && pnpm test
  • Land commit: a424103
  • Merge commit: 762fed1

Thanks @chocobo9!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openclaw gateway status fails on EC2/headless servers due to missing user-level systemd

2 participants