systemd Service Failed to Start — Unit Activation Error and Debugging
Errorsystemd
Overview
Fix systemd service startup failures by reading journal logs, understanding unit dependencies, and debugging ExecStart configuration issues.
Key Details
- systemd manages service lifecycle through unit files (.service) in /etc/systemd/system/ or /lib/systemd/system/
- Service failures show as 'failed' in systemctl status and are logged in the journal
- Common failure types: ExecStart binary not found, permission denied, dependency not met, crash after start
- The journal (journalctl) contains detailed startup logs including stdout/stderr of the service process
- Services have dependencies (Requires, After, Wants) that must be satisfied before starting
Common Causes
- ExecStart path incorrect or binary not found at the specified path
- Service user does not have permission to access required files or ports
- Dependency service not running (e.g., database not started before the application)
- Application crashes immediately after starting due to configuration errors
Steps
- 1Check service status and error: 'systemctl status service-name.service' for overview
- 2Read detailed logs: 'journalctl -u service-name.service -n 50 --no-pager' for last 50 log lines
- 3Verify ExecStart path: 'which binary-name' or 'ls -la /path/to/binary' to confirm it exists and is executable
- 4Test the command manually: run the ExecStart command directly as the service user to see errors
- 5After fixing the unit file: 'systemctl daemon-reload' then 'systemctl start service-name'
Tags
systemdservicefailedunit-filejournal
More in Systemd
linux-systemd-service-failedLinux systemd Service Failed to Start — Unit Entered Failed State
Errorlinux-systemd-dependency-failedLinux systemd Dependency Failed — Service Cannot Start
Errorlinux-systemd-journal-errorsLinux systemd Journal Errors — Failed Services, Dependencies & Timers
Warninglinux-systemctl-service-errorsSystemctl Service Errors — Failed to Start, Dependency, and Unit File Issues
Errorlinux-journalctl-usage-guideJournalctl Usage Guide — Reading System Logs and Debugging Services
Informationallinux-systemd-timer-errorsSystemd Timer Errors — Replacing Cron with Systemd Timers and Troubleshooting
WarningFrequently Asked Questions
Put custom service files in /etc/systemd/system/. Files in /lib/systemd/system/ are managed by packages and may be overwritten during updates. Run systemctl daemon-reload after creating or modifying unit files.