Services and systemctl

Services run in the background

A service (or daemon) is a program that runs in the background to do a job: serve web pages, accept logins, write logs. On almost every modern Linux, these are started and supervised by systemd, the first process to run at boot (PID 1). You talk to it with systemctl.

systemctl list-units --type=service lists the services systemd knows about and their state. --state=running narrows it to the ones actually running:

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

In the terminal

student@vulntech:~$ systemctl list-units --type=service --state=running --no-pager
  UNIT                       LOAD   ACTIVE SUB     DESCRIPTION
  dbus.service               loaded active running D-Bus System Message Bus
  serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0
  systemd-journald.service   loaded active running Journal Service
  systemd-logind.service     loaded active running User Login Management
  systemd-udevd.service      loaded active running Rule-based Manager for Devic…
  vt-agent.service           loaded active running VulnTech lab agent (private …

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
6 loaded units listed.

Is one service up? systemctl status

Each service is a unit named something.service. systemctl status NAME shows whether it's running, since when, its main process, and its most recent log lines. is-active answers just yes/no, which is perfect for scripts:

systemctl status vt-agent.service --no-pager
systemctl is-active vt-agent.service

In the terminal

student@vulntech:~$ systemctl status vt-agent.service --no-pager
● vt-agent.service - VulnTech lab agent (private channel on ttyS1)
     Loaded: loaded (]8;;file://vulntech/etc/systemd/system/vt-agent.service/etc/systemd/system/vt-agent.service]8;;; enabled; preset: enabled)
     Active: active (running) since Sun 2026-10-18 04:44:40 UTC; 2h 4min ago
   Main PID: 218 (vt-agent)
      Tasks: 1 (limit: 1071)
     Memory: 24.4M
        CPU: 24.097s
     CGroup: /system.slice/vt-agent.service
             └─218 /bin/bash /usr/local/sbin/vt-agent
student@vulntech:~$ systemctl is-active vt-agent.service
active

Tip: You can drop the .service suffix: systemctl status vt-agent works. Other unit types exist too — .socket, .timer, .mount — and systemctl list-units shows them all.

Remember: systemd (PID 1) runs the system's services. systemctl list-units --type=service lists them, systemctl status NAME inspects one, systemctl is-active NAME says whether it's running.

HOME LEARN COMMUNITY DASHBOARD
Practice terminal Starting…