Mad World #Save_GAZA: Free Palestine  

Search

systemctl List Services: Running, Enabled and Failed

systemctl List Services: Running, Enabled and Failed

To list the services on a Linux server that uses systemd (Ubuntu, Debian, Fedora, RHEL, Arch and most others), run systemctl list-units --type=service --state=running. It prints every service that is running now, with its state and a short description. Other options of the same command list the services that start at boot, the ones that failed, and every service installed.

We ran each command below on 2 December 2026 on a small Ubuntu 26.04.1 LTS server with systemd 259: nginx, OpenSSH, cron, unattended-upgrades, and a backup service that copies a folder to a backup disk with rsync. The disk was not mounted, so the backup failed at boot. Every screenshot comes from that server.

Quick answer: systemctl commands to list services

What you wantCommandOn our server
Services running nowsystemctl list-units --type=service --state=running6
Running, exited and failed servicessystemctl list-units --type=service19
Every loaded service, inactive ones toosystemctl list-units --type=service --all87
Every installed service filesystemctl list-unit-files --type=service153
Services that start at bootsystemctl list-unit-files --type=service --state=enabled8
Failed servicessystemctl --failed1
One service in detailsystemctl status nginx

Listing needs no root. Add --no-pager if you do not want the list to open in a pager, and --no-legend to drop the header and the count at the end.

List running services with systemctl

Terminal
systemctl list-units --type=service --state=running
Terminal: systemctl list-units --type=service --state=running lists cron, dbus, nginx, systemd-journald, systemd-logind and unattended-upgrades, 6 loaded units listed
1: the six services running on our server, with the legend and the count.

Each line is one unit: UNIT is the service's name, LOAD says whether systemd read its unit file, ACTIVE is the general state (active, inactive, failed) and SUB the detailed one (running, exited, dead, failed). --state=running keeps the lines whose SUB state is running: the six services our server runs, from nginx to the journal. The last line gives the count.

A running service is not always one you installed: dbus, systemd-journald and systemd-logind are part of the system itself. On a full Ubuntu server install the list is longer (networking, time sync, snapd), but it reads the same way.

List all services: active, inactive and installed

Without --state, systemctl lists the services that are active or failed:

Terminal
systemctl list-units --type=service
Terminal: systemctl list-units --type=service lists 19 services: backup.service failed, cron, dbus and nginx running, and one-time boot services exited
1: running, exited and failed services; the last lines say how to see more.

The list grows from 6 to 19. The services marked exited ran once at boot and finished: they did their job and are still counted as active. The failed backup shows in red with a dot. The last lines say that --all shows the inactive services too, and that systemctl list-unit-files shows every installed one. We counted each list:

Terminal
systemctl list-units --type=service --state=running --no-legend | wc -l
systemctl list-units --type=service --no-legend | wc -l
systemctl list-units --type=service --all --no-legend | wc -l
systemctl list-unit-files --type=service --no-legend | wc -l
Terminal: counts of services: 6 running, 19 listed by default, 87 with --all, 153 installed unit files
1: running. 2: listed by default. 3: every loaded service, inactive too. 4: every installed service file.
CommandServicesWhat it counts
--state=running6Running now
default (no option)19Active (running or exited) and failed
--all87Every unit systemd has in memory, inactive and not-found ones too
list-unit-files153Every service file on disk, loaded or not, with its enabled state

list-units shows what systemd has loaded; list-unit-files shows what is installed. A service that was never started and that nothing depends on is only in the second list.

List enabled services (the ones that start at boot)

Enabled means "starts at boot", which is not the same as running now. list-unit-files gives the enabled state:

Terminal
systemctl list-unit-files --type=service --state=enabled
systemctl is-enabled ssh.service ssh.socket
systemctl is-active ssh.service ssh.socket
Terminal: systemctl list-unit-files --type=service --state=enabled lists 8 unit files; ssh.service is disabled and inactive while ssh.socket is enabled and active
1: the services that start at boot. 2: ssh.service is disabled, ssh.socket enabled. 3: the socket is active, the service waits.

Eight services are enabled on our server. PRESET is the state the distribution chose for each one. The list holds backup.service, which is enabled but failed, and [email protected], a template that starts login prompts on consoles. A running service can also be missing from it: dbus.service and systemd-journald.service run because other units need them, not because they are enabled.

SSH is the usual surprise on Ubuntu: ssh.service is disabled and inactive, yet SSH logins work. ssh.socket is enabled and active: systemd itself waits for SSH connections and starts the SSH server when one comes in (socket activation). So check the socket too before you decide SSH is off.

List failed services and find out why

Terminal
systemctl --failed
systemctl is-system-running
sudo systemctl status backup.service
Terminal: systemctl --failed lists backup.service; is-system-running says degraded; sudo systemctl status backup.service shows the rsync error mkdir /mnt/backup/data failed
1: the failed service. 2: one failed unit makes the whole system degraded. 3: the reason, in the last log lines.

systemctl --failed lists only the units that failed; here, the backup. One failed unit is enough for systemctl is-system-running to answer degraded instead of running, which makes that command a simple check for monitoring scripts.

systemctl status gives the reason. Active: failed (Result: exit-code) means the program exited with an error; the Process line shows the command and its exit status (11). The log lines below it say what happened: rsync could not create /mnt/backup/data because /mnt/backup did not exist, as the backup disk was not mounted. Without sudo, the status showed our user no log lines: reading the system log needs root (or the adm or systemd-journal group). The hint at the end says to add -l for lines cut at the screen's width.

Fix the cause, then start the service again

On our server the backup needed its target folder. We created it and started the service:

Terminal
sudo mkdir -p /mnt/backup
sudo systemctl start backup.service
systemctl --failed
systemctl is-system-running
Terminal: sudo mkdir -p /mnt/backup, sudo systemctl start backup.service, systemctl --failed lists 0 units, is-system-running says running
1: the missing folder. 2: the backup runs. 3: no failed service left. 4: the system is running again.

The backup ran, no failed service was left, and the system was running again. A one-time service such as this backup is inactive (dead) after a successful run, so it does not appear in the running list: that is normal for a job that ends.

Clear the failed state without a fix

To clear an old failure you already know about, use reset-failed. We removed the folder again, so the backup failed on start, then cleared it:

Terminal
sudo systemctl start backup.service
systemctl --failed --no-legend
sudo systemctl reset-failed backup.service
systemctl --failed --no-legend
systemctl is-system-running
Terminal: the backup fails again on start; systemctl --failed shows it; after sudo systemctl reset-failed backup.service the list is empty and the system is running
1: the start fails. 2: it is listed as failed. 3: the failed state is cleared. 4: the list is empty. 5: running, though nothing was fixed.

The failure is gone from the list and the system says running, but nothing was fixed: the next start fails again. Use it after a fix, or for a service you removed.

Check one service with systemctl status

Terminal
systemctl status nginx
systemctl is-active nginx
Terminal: systemctl status nginx shows loaded and enabled, active (running), main PID 78, 9 tasks, 6.2M memory and the worker processes; is-active nginx prints active
1: state, start time, PID, memory and processes of one service. 2: the one-word answer for scripts.

The status of one service gives its unit file and whether it is enabled (Loaded), its state and the time it started (Active), its main process, the number of tasks, its memory use and the processes in its control group (nginx: one master and eight workers). In a script, systemctl is-active nginx prints one word and returns exit code 0 only when the service is active; systemctl is-enabled prints the boot state the same way.

Service names only, for scripts

Terminal
systemctl list-units --type=service --state=running --no-legend --plain | cut -d " " -f 1
Terminal: systemctl list-units with --no-legend --plain and cut prints only the six running service names
1: one name a line, ready for a script.

--no-legend removes the header and the count, --plain removes the dot that systemctl puts in front of a failed unit, and cut keeps the first column. The output is one service name a line, ready for a loop or a monitoring check. For a long-running watch of a server's services, Beszel shows them with alerts.

service --status-all: the old command

service --status-all comes from before systemd, and many answers still give it:

Code
service --status-all
Terminal: service --status-all lists cron, dbus, nginx, procps and unattended-upgrades with a plus, rsync and ssh with a minus, and no backup service
1: only the services that ship an old init script; backup.service is missing.

It lists only the services that ship an old init script in /etc/init.d: [ + ] running, [ - ] stopped. The backup service, which has only a systemd unit, is missing, and ssh shows [ - ] though SSH logins work through the socket. On a systemd server, use systemctl.

Frequently asked questions

How do I list all services in Linux?

On a systemd distribution, systemctl list-units --type=service --all lists every service systemd has loaded, and systemctl list-unit-files --type=service every service file installed. On our Ubuntu 26.04.1 server that was 87 and 153.

How do I list only running services?

systemctl list-units --type=service --state=running. Add --no-legend --plain and cut -d " " -f 1 for the names only.

What is the difference between list-units and list-unit-files?

list-units shows the units systemd has loaded, with their current state. list-unit-files shows the files installed on disk, with their enabled state, whether they run or not.

Why is a service enabled but not running?

Enabled only means it starts at boot. It may have failed (our backup), finished its job (a one-time service), or be stopped by hand. systemctl status with the service's name says which.

Why is ssh.service disabled on Ubuntu?

Ubuntu starts SSH through ssh.socket: systemd waits for connections and starts the SSH server on the first one. On our server ssh.socket was enabled and active while ssh.service was disabled and inactive.

What does "degraded" mean?

systemctl is-system-running answers degraded when at least one unit failed. systemctl --failed lists them; after a fix or a reset-failed it answers running.

How do I clear a failed service?

Fix the cause and start the service again, or run sudo systemctl reset-failed with the service's name to clear the failed state without a fix.

Sources

Yassine

Yassine runs IGPROD and has written about Synology NAS, Docker and self-hosting here since 2022. About IGPROD

Leave a comment

Your email address will not be published. Required fields are marked *

Your experience on this site will be improved by allowing cookies Cookie Policy