Fix a systemd service that fails
We'll check systemctl status, journalctl -xe, ExecStart path, unit file, and permissions—or tell you when to escalate.
What you'll need
- SSH or console access with sudo
Step-by-step diagnostic
Quick triage — pick your path
Quick triage — pick your path
Choose the option that matches what you see. You can jump straight to that section.
- Follow this guide Work through the full procedure.
- Check status and logs You want to see the error first.
- Check ExecStart and unit file You suspect the path or config is wrong.
- Fix permissions or ports The log says permission denied or address in use.
- When to escalate Config management or application-level fix needed.
Show full guide
Steps
Goal: Confirm the service fails, read the error from journalctl, then fix ExecStart, permissions, or port—or escalate.
- Run
systemctl status servicenameto see the current state. - Good: You see failed, inactive, or activating. Proceed to Check status and logs.
- Bad: Service not found—check the exact unit name with systemctl list-units.
Check status and logs
Goal: See why the service failed.
- Run
systemctl status servicename. Note the Active line and the error. - Run
journalctl -xefor recent system logs, orjournalctl -u servicename -n 50for service-specific logs. Look for Permission denied, failed to execute, no such file, or address already in use. - Good: You see the error. Proceed to Check ExecStart and unit file.
- Bad: Logs unclear—run systemctl cat servicename to inspect the unit.
Check ExecStart and unit file
Goal: Confirm the ExecStart path and unit config are valid.
- Run
systemctl cat servicenameto see the effective unit. Check ExecStart=—the path must exist. Runwhich binaryorls -la /path/to/binaryto confirm. - Check User= and Group= if the service runs as non-root. Check WorkingDirectory= if it needs a specific cwd.
- Good: Path exists and config looks correct. Proceed to Fix permissions or ports if the error points there.
- Bad: ExecStart path wrong or missing—use
sudo systemctl edit servicenameto override, then daemon-reload and restart.
Fix permissions or ports
Goal: Fix permission denied or port conflicts.
- If “Permission denied”: run
ls -laon config files and data dirs. Usechownorchmodso the service user can access them. - If “address already in use”: run
ss -tlnporlsof -i :portto find the conflicting process. Stop it or change the port in your config. - Run
sudo systemctl daemon-reloadandsudo systemctl restart servicename. - Good: Service starts and systemctl status shows active (running).
- Bad: Still fails—test the executable manually or escalate.
When to escalate
Escalate if:
- The service is managed by Puppet, Ansible, or Chef.
- The fix requires application code changes.
- You cannot safely modify the unit file.
Provide systemctl status, journalctl -u servicename output, and systemctl cat servicename.
Verification
systemctl status servicenameshows active (running).- No errors in
journalctl -u servicename -n 20. - The service responds as expected (e.g. port listening, process running).
Escalation ladder
Work from the device outward. Stop when the problem is fixed.
- Status and logs systemctl status; journalctl -xe or journalctl -u servicename.
- Unit file and ExecStart systemctl cat; fix ExecStart path, User, WorkingDirectory.
- Permissions and ports chown/chmod; check port conflicts with ss/lsof.
- Escalate Provide status, journalctl, unit file.
What to capture if you need help
Before calling support or posting for help, have these ready. It speeds everything up.
- systemctl status output
- journalctl -u servicename output (or journalctl -xe)
- Unit file (systemctl cat)
- Steps already tried
What does journalctl show for the service?
Read the last 50 lines of service logs or journalctl -xe.
You can change your answer later.
Check status and ExecStart
Apply fix
You can change your answer later.
Test executable manually
Service is running
Reviewed by Blackbox Atlas
Frequently asked questions
- Why would a systemd service fail to start?
- Wrong ExecStart path, permission denied, port already in use, missing dependency, or config error in the unit file. Check systemctl status and journalctl first.
- Can I fix a failing systemd service myself?
- Yes. Read journalctl for the error, fix ExecStart path or permissions, check port conflicts. Use systemctl edit servicename for overrides, then systemctl daemon-reload and restart.
- When should I escalate service failures?
- If the service is managed by config management, the fix requires application-level changes, or you cannot safely modify the unit file.
Rate this guide
Was this helpful?
Thanks for your feedback.