jcrabapple/hermes-skills/systemd-service-crash-loop-fix
Claude Code and agent skill by jcrabapple/hermes-skills
- community
Checking that the SKILL.md file is still in the repository.
Diagnose and fix systemd user service crash loops where the service binary can't find its runtime (node, python, etc.) because systemd doesn't inherit the user's shell environment (nvm, pyenv, volta, brew). Use when a service shows status 127 or "No such file or directory" from env, or when journalctl shows repeated restarts every ~5-10s.
Install
npx vskill@latest install jcrabapple/hermes-skills/systemd-service-crash-loop-fixSKILL.md
The same SKILL.md was published earlier as jcrabapple/hermes-skills/systemd-service-crash-loop-fix.
Fix Systemd User Service Crash Loops from Missing Runtime PATH
Diagnosis
1. Check service status and restart counter
Look for:
Result: exit-codewith status 127 (command not found)- High restart counter (thousands = crash looping for hours/days)
activating (auto-restart)state
2. Check journal logs for the root cause
Common errors:
env: 'node': No such file or directory— nvm-installed node not in PATHenv: 'python3': No such file or directory— pyenv-installed python not in PATHNo such file or directoryon a script that exists — shebang interpreter missing from PATH
3. Verify the runtime exists but isn't in systemd's PATH
Fix
Add explicit PATH to the service file
Edit the service file and add an Environment="PATH=..." line in the [Service] section:
Then reload and restart:
Common PATH values by runtime manager
| Manager | Runtime | PATH entry | |
|---|---|---|---|
| nvm | node | ~.nvm/versions/node/vXX.XX.X/bin | |
| pyenv | python | ~.pyenv/shims:~.pyenv/bin | |
| volta | node/npm | ~.volta/bin | |
| linuxbrew | any | /home/linuxbrew/.linuxbrew/bin |
Pitfalls
- Restart counter in tens of thousands: A service restarting every 10s for 24+ hours accumulates 8,000+ restarts. Fix immediately — it wastes resources and clutters logs.
- Don't just disable the service: If the user wants it running, fix the PATH. Only disable if the service is genuinely unused.
- `serve` and other npx-installed tools: Tools installed via
npm install -gorbunxuse#!/usr/bin/env nodeshebangs. They break under systemd for the same reason — node isn't in PATH. - RestartSec=10 is aggressive: For services that legitimately crash-loop during startup (e.g., waiting for a dependency), consider increasing to 30-60s or adding a
ExecStartPrehealth check. - Hardcoded node version: If the service file references a specific nvm node version (e.g.,
v22.21.1), it will break when node is upgraded. Consider using a symlink or volta instead.
Verification
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdevops/systemd-service-crash-loop-fix/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jcrabapple/hermes-skills/systemd-service-crash-loop-fix)