Skip to content

Q&A · Answered

systemctl service failing to start - debugging steps

asked 9 months, 1 week ago 1923 views 1 answer
22

My custom service fails to start with systemctl. It just says "failed" without useful information. How can I debug this?

1 Answer

One accepted
5

Accepted answer

Not confirmed since it was written, 9 months, 1 week ago

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

Your answer

Say what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.

Shown beside your answer and never checked, so it cannot be a name someone already has here.

No account needed to answer. Sign in instead and it carries your name and earns reputation.