systemd Service Failed to Start? Troubleshooting Guide for Linux

systemd service failed to start - custom-svcfail-featured.png

When systemctl start myapp returns failed, the one-line error is rarely the full story. The real reason is almost always in
journalctl -u myapp — missing binary, wrong working directory, or a dependency that never became active.

Build on systemctl basics and
writing custom units.

Read status and Exit Code

systemctl status shows the main PID, last few log lines, and whether the unit is enabled.

bashfirst commands
sudo systemctl status myapp.service --no-pager
sudo systemctl start myapp.service
failed unit
status first

Decode Active: failed

Note whether it failed immediately (bad ExecStart) or after running (app crash).

Active failed
immediate vs crash

Full Logs with journalctl

Always pull the complete unit log for the current boot.

bashlogs
sudo journalctl -u myapp.service -b --no-pager | tail -80
journalctl -u
no pager

ExecStart and Permissions

Typos in paths, scripts without execute bit, or User= that cannot read files cause instant failure.

bashcheck binary
ls -l /usr/local/bin/myapp
sudo -u appuser /usr/local/bin/myapp
ExecStart
path and chmod

Dependencies and Ordering

If After=network-online.target is set but network is not ready, the service may fail or flap.

bashverify unit file
systemd-analyze verify /etc/systemd/system/myapp.service
After Requires
ordering

After Editing the Unit

Run daemon-reload before restart.

bashapply
sudo systemctl daemon-reload
sudo systemctl restart myapp.service
daemon-reload
restart

Confirm Healthy

Check active state and your app health endpoint.

bashverify
systemctl is-active myapp.service
systemctl is-enabled myapp.service
verify
is-active

Quick Reference

  • journalctl -u NAME -b has the real error
  • Check ExecStart path, +x, and User=
  • daemon-reload after unit edits

Related tutorials

Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.