When a Service Won't Start

A failed service

When a service won't start, systemd marks it failed and keeps the reason. Here's a service whose command doesn't exist. Starting it fails, and systemctl status shows the failed state and the error:

sudo systemctl start brokenapp
systemctl status brokenapp --no-pager
systemctl is-active brokenapp

In the terminal (start fails, so it returns non-zero and status shows the service failed)

student@vulntech:~$ sudo systemctl start brokenapp
[sudo] password for student:
student@vulntech:~$ systemctl status brokenapp --no-pager
× brokenapp.service - Broken app
     Loaded: loaded (]8;;file://vulntech/etc/systemd/system/brokenapp.service/etc/systemd/system/brokenapp.service]8;;; static)
     Active: failed (Result: exit-code) since Sun 2026-10-18 06:50:18 UTC; 3s ago
   Duration: 482ms
    Process: 609 ExecStart=/usr/local/bin/doesnotexist (code=exited, status=203/EXEC)
   Main PID: 609 (code=exited, status=203/EXEC)
        CPU: 39ms
student@vulntech:~$ systemctl is-active brokenapp
failed

The full story: sudo journalctl -u

systemctl status shows only the last few log lines. sudo journalctl -u NAME shows all of a service's log, the first place to look when something's wrong:

sudo journalctl -u brokenapp --no-pager | tail -n 10

In the terminal

student@vulntech:~$ sudo journalctl -u brokenapp --no-pager | tail -n 10
[sudo] password for student:
Oct 18 06:53:16 vulntech systemd[1]: Started brokenapp.service - Broken app.
Oct 18 06:53:16 vulntech (notexist)[603]: brokenapp.service: Failed to locate executable /usr/local/bin/doesnotexist: No such file or directory
Oct 18 06:53:16 vulntech (notexist)[603]: brokenapp.service: Failed at step EXEC spawning /usr/local/bin/doesnotexist: No such file or directory
Oct 18 06:53:18 vulntech systemd[1]: brokenapp.service: Main process exited, code=exited, status=203/EXEC
Oct 18 06:53:18 vulntech systemd[1]: brokenapp.service: Failed with result 'exit-code'.

The log names the problem: the executable wasn't found. Fix the ExecStart line, daemon-reload, and start it again.

Common mistake: After editing a unit file you must run systemctl daemon-reload, or systemd keeps using the old version and your change seems to do nothing. A failed unit also needs systemctl reset-failed NAME (or a successful start) to clear its failed state.

Remember: A service that won't run is failed. systemctl status NAME shows the state and last error; sudo journalctl -u NAME shows the full log. Fix the unit, daemon-reload, start again.

HOME LEARN COMMUNITY DASHBOARD
Practice terminal Starting…