Find a command/
中文
☰

← Back to overviewAll commands

Essential check 3 / 3

03 / FIELD NOTES

Check services and listening ports

List failed systemd units, listening ports, and recent errors.

Why this way

Look at actual service state before restarting things. A port conflict or a clear error log often explains a failed deployment.

When to use

After installing a service, or when a web application does not respond.

When not to

These commands assume systemd. On Alpine (OpenRC) use rc-status and the logs under /var/log.

Prerequisites

  • A systemd system (Debian, Ubuntu, Rocky, AlmaLinux). Alpine uses rc-status instead
  • root or sudo to inspect all process information

Steps

Find failed services

Read-only
systemctl --failed --no-pager

Expect: An empty list means no systemd units are currently marked failed.

Inspect TCP listeners

Read-only
sudo ss -lntp

Expect: Check which process owns a port and whether it binds to loopback or all interfaces.

Read recent boot errors

Read-only
sudo journalctl -p err -b -n 30 --no-pager

Expect: Read the error before making changes. Logs may contain private information.

What it changes

Read-only. Does not restart services or change firewall rules.

Essential checks

← Previous: The SSH port that actually wins