Skip to content
Log In Sign Up info@muvcloud.com

List Running Services

systemctl list-units --type=service --state=running

Each line is one service, with five columns:

ColumnMeaning
UNITThe service name, such as nginx.service.
LOADWhether systemd read the unit file.
ACTIVEThe general state: active, inactive, or failed.
SUBThe detailed state, such as running or exited.
DESCRIPTIONA short description.

Add --no-pager to print the list without the scrolling viewer, which is useful in scripts and when you pipe the output to grep.

All Loaded Services

systemctl list-units --type=service
systemctl list-units --type=service --all

Without --all, systemctl shows only the services that are active, failed, or waiting for a pending job. With it, inactive ones appear too. Services that exited after doing their work, such as one-time setup tasks, show active and exited; that is normal.

List Failed Services

systemctl --failed
systemctl list-units --type=service --state=failed

The first command lists failed units of every type, such as mounts and timers; the second lists failed services only. For each failed service, read why it stopped:

systemctl status nginx
journalctl -u nginx -b --no-pager | tail -50

After you fix the cause and restart the service, it leaves the list. To clear an entry for a service you no longer need, run sudo systemctl reset-failed nginx. Run systemctl --failed after every reboot; the checklist is in how to reboot a Linux server.

All Installed Services and Boot Settings

systemctl list-unit-files --type=service
systemctl list-unit-files --type=service --state=enabled

This lists unit files on disk, whether they run or not. The STATE column tells you what happens at boot:

  • enabled: starts at boot.
  • disabled: does not start at boot, but can be started by hand.
  • static: cannot be enabled on its own; another unit or a timer starts it.
  • masked: blocked completely; it cannot be started until unmasked.

Check One Service

CommandAnswers
systemctl is-active nginxactive or inactive
systemctl is-enabled nginxenabled or disabled
systemctl is-failed nginxfailed or not
systemctl status nginxState, PID, memory, last log lines

The is- commands also set an exit code, so a script can test them: systemctl is-active --quiet nginx || echo "nginx is down".

Filter the List

systemctl accepts a name pattern in quotes:

systemctl list-units 'php*'
systemctl list-units --type=service | grep -i mysql

Service names differ between distributions. SSH is ssh on Debian and Ubuntu and sshd on AlmaLinux and Rocky Linux; cron is cron or crond; Apache is apache2 or httpd. If a name is not found, list with a pattern first.

Start, Stop, and Enable

CommandEffect
sudo systemctl start nginxStarts it now.
sudo systemctl stop nginxStops it now.
sudo systemctl restart nginxStops and starts it.
sudo systemctl reload nginxRereads its configuration.
sudo systemctl enable --now nginxStarts it and at every boot.
sudo systemctl disable nginxRemoves it from boot.

Test a configuration before a restart, for example with sudo nginx -t, and be careful with the SSH service, as described in how to change the SSH port. Timers, systemd's scheduled jobs, are listed with systemctl list-timers; see how to list cron jobs. To write a service of your own, read systemd unit files explained.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations