Skip to content

fix(daemon): detect both user and system systemd services#2

Open
kevinWangSheng wants to merge 1 commit intomainfrom
fix/systemd-service-detection
Open

fix(daemon): detect both user and system systemd services#2
kevinWangSheng wants to merge 1 commit intomainfrom
fix/systemd-service-detection

Conversation

@kevinWangSheng
Copy link
Owner

Summary

Fixes openclaw#27267: openclaw status incorrectly reports 'systemd not installed' when gateway is running via systemd (system-wide service).

Changes

  • Modified assertSystemdAvailable to check both user and system scope systemd
  • Added detectSystemdScope function for explicit scope detection
  • Updated execSystemctl to support optional --user flag

Problem

When the OpenClaw Gateway is started via systemctl enable --now openclaw-gateway (system-wide systemd service), the CLI command openclaw status still shows:

Gateway service │ systemd not installed

This is because the code only checked for user systemd services (using --user flag), not system-wide services.

Solution

The fix checks both user and system systemd scopes, prioritizing user services but falling back to system services if user services are not available.

- Modified assertSystemdAvailable to check both user and system scope
- Added detectSystemdScope function for explicit scope detection
- Updated execSystemctl to support optional --user flag
- Fixes openclaw#27267: openclaw status incorrectly reports 'systemd not installed' when gateway is running via systemd
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.

[Bug]: openclaw status incorrectly reports "systemd not installed" when gateway is running via systemd

1 participant