Skip to content

fix(cli): prevent crash on Linux runtimes lacking systemctl - #3727

Closed
devorun wants to merge 1 commit into
NousResearch:mainfrom
devorun:patch-18
Closed

fix(cli): prevent crash on Linux runtimes lacking systemctl#3727
devorun wants to merge 1 commit into
NousResearch:mainfrom
devorun:patch-18

Conversation

@devorun

@devorun devorun commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #3724

Root Cause:
When running hermes status on minimal Linux distributions, Docker containers, WSL, or custom setups (like CatchyOS) that lack systemd, the CLI crashes with an unhandled FileNotFoundError. The code previously assumed systemctl was always available in the PATH if sys.platform.startswith('linux') evaluated to True.

Fix:
Updated the status check logic in hermes_cli/status.py to use shutil.which("systemctl") before attempting to spawn the subprocess.

  • If systemctl exists, the status check proceeds normally.
  • If it is missing, the CLI gracefully falls back, displaying that systemd is unavailable in the current runtime, preventing the crash.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

@teknium1

Copy link
Copy Markdown
Contributor

Closing as duplicate — this issue is fixed in #8614 (salvaged from @alt-glitch's comprehensive #8573). Thanks for the contribution!

@teknium1 teknium1 closed this Apr 12, 2026
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]: hermes status crashes on Linux runtimes lacking systemctl

2 participants