systemctl service failing to start - debugging steps
Answered
22
My custom service fails to start with systemctl. It just says "failed" without useful information. How can I debug this?
S
Asked by
security_pro
Bronze
•
259 rep
1 Answer
5
Here's a comprehensive approach to debug systemd service failures:
Check service status and logs
# Get detailed status
sudo systemctl status yourservice.service -l
# View recent logs
sudo journalctl -u yourservice.service -n 50 --no-pager
# Follow logs in real-time
sudo journalctl -u yourservice.service -f
Test the command manually
# Check your service file
cat /etc/systemd/system/yourservice.service
# Run the ExecStart command manually to see errors
/path/to/your/command
Common fixes
# Reload after editing service file
sudo systemctl daemon-reload
# Check permissions on executable
ls -la /path/to/your/command
# Check working directory exists
ls -la /path/to/working/dir
A
Platinum
•
151 rep
Your Answer
You need to be logged in to answer questions.
Log In to Answer