When a service misbehaves, guessing and restarting can destroy evidence. A fixed order of questions is faster and calmer.
Define the problem
Write down what fails, who sees it, when it started, and what changed. "Uploads fail for everyone since 09:00" is far more useful than "the site is broken". Compare with your normal values.
Check the service
$ systemctl status myapp
× myapp.service - My App
Loaded: loaded (/etc/systemd/system/myapp.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2026-03-03 09:00:12 UTC
$ sudo journalctl -u myapp --since "2026-03-03 08:55" -n 50myapp is a placeholder. The status shows whether it runs; the journal often says why it stopped.
Work along the request path
Test one layer at a time:
getent hosts app.example.com # does the name resolve?
sudo ss -ltnp # is something listening on the port?
curl -v http://127.0.0.1:8080/ # does it answer locally?
curl -v http://app.example.com/ # does it answer by name?Replace the port and name with yours. If the local request works but the remote one fails, look at the bind address, firewall, proxy, DNS or network. A service listening on 127.0.0.1 accepts connections only from the same machine.
"Connection refused" usually means nothing is listening there, or a firewall actively rejected it. A timeout often means packets are being dropped or the server is not responding.
Check resources and configuration
Run df -h, df -i and free -h. Many programs can validate their configuration before a restart, for example sudo nginx -t or sudo sshd -t.
Change one thing
Form one idea about the cause, predict what you would see if it were true, then test it. Make one change at a time and keep a note of it, so you can undo it. Before restarting, save the relevant logs and status output.
After a fix, repeat the original failing action. A green service status is not proof that users are served again. Then record the cause and add a check or alert that would catch it sooner.
Try it
On a test machine, stop a web server, request it with curl -v, and read the error. Start it again and confirm the same request succeeds. For a related exercise, try diagnosing a broken default route.
Check your understanding
Service Troubleshooting
All 4 sections · no timer
Unlimited retries
Questions from every section are combined into one assessment. Answer them all correctly to complete the article.
Your completion saves in this browser. Sign in to sync it to your account.