Back to skills
extension
Category: OtherNo API key required

Linux Systemd Doctor

Diagnose and fix failed Linux systemd services. Check service status, read journalctl logs, analyze unit files, fix dependencies, port conflicts, and permiss...

personAuthor: laolaoqihubclawhub

Linux systemd Doctor

Troubleshoot and fix broken systemd services.

Quick Diagnosis

# Check service status
systemctl status SERVICE --no-pager -l

# View full journal
journalctl -u SERVICE -n 100 --no-pager

# Follow live logs
journalctl -u SERVICE -f

Common Fixes

Service won't start

  1. Check syntax
    systemctl cat SERVICE
    
  2. View full error
    journalctl -u SERVICE -n 50 --no-pager -x
    
  3. Test the ExecStart command directly
  4. Check ExecStartPre failures
  5. Verify file permissions on all referenced paths

Service keeps restarting (Restart=always loop)

# Stop the restart loop
systemctl stop SERVICE

# Check the actual error
journalctl -u SERVICE -n 200 --no-pager

# Temporary fix: set Restart=no to debug
systemctl edit SERVICE
# Add:
# [Service]
# Restart=no

Service File Reference

| Directive | Purpose | |-----------|---------| | ExecStart | Main command | | ExecStartPre | Pre-start checks | | ExecReload | Reload command | | Restart=on-failure | Auto-restart strategy | | RestartSec=5 | Wait time between restarts | | StartLimitIntervalSec=60 | Rate limiting | | User= | Unprivileged user | | WorkingDirectory= | CWD for service | | Environment= | Env variables | | LimitNOFILE= | File descriptor limit |

Port Conflict Check

# Check if service port is occupied
systemctl cat SERVICE | grep -i port
ss -tlnp | grep ":<PORT> "

📢 Need Help?

Need OpenClaw deployed on your server? I offer managed deployment & hosting:

  • 📧 laolaoqi@hotmail.com
  • 🏯 颐和园 OpenClaw 运维