A program that runs as a service, for example a torrent client, a web server or your own app, sometimes does not start, or stops after a few seconds. Linux records the reason; two commands show it. The commands were tested on Ubuntu 26.04 LTS with a deliberately broken test service; run them as root. Below, replace myapp with the name of your service.
1. The State: systemctl status
systemctl status myapp
A broken service shows, for example:
× kb-myapp.service - KB test app
Active: failed (Result: exit-code) since Sat 2026-11-28 03:36:17 UTC
Process: 72480 ExecStart=/usr/local/bin/kb-myapp --port 8099 (code=exited, status=203/EXEC)
Active: failed: the service has stopped with an error;active (running)would be good.status=…gives a first hint.203/EXECmeans the program itself could not be started;1/FAILUREmeans it started and ended with an error.
Below that, the last lines of its log are shown. Often they are already enough.
2. The Whole Log: journalctl
journalctl -u myapp -b --no-pager | tail -30
-u selects the service, -b limits it to the time since the last start of the server. The log usually names the cause, for example:
Unable to locate executable '/usr/local/bin/kb-myapp': No such file or directory: the program is missing or the path in the service file is wrong.Error: cannot open /srv/myapp/config.yml: Permission denied: a message of the app itself; here the service user may not read its settings file.Start request repeated too quickly: the service crashed several times in a row and systemd gave up. The real cause is further up in the log.
3. Typical Causes and Where to Look
- Port already in use (
address already in use): another program listens on the port; See Which Programs Listen on Your Linux Server. - Permission denied: owner or permissions of files and folders; File Permissions on Linux: Who May Read, Change and Run a File.
- A typo in the settings: many programs check them, for example
nginx -torsshd -t. - Disk full:
No space left on device; What Fills the Disk and What Loads the Server.
4. Start It Again
systemctl reset-failed myapp systemctl start myapp systemctl status myapp
reset-failed clears the failure counter after Start request repeated too quickly. If you changed the service file itself, run systemctl daemon-reload first. systemctl --failed lists every service that is currently in the failed state.
How services are set up: Keep a Program Running on Linux. All logs: Find Errors in the Logs of Your Linux Server: journalctl.