Linux Units
Table of Contents
Linux units#
Units are configuration files that describe the resources that are managed by systemd. They are stored in four filesystem paths. If I do a manual search I can approximately tell where they are:
Wassim@linux:~$ find / -mindepth 1 -name systemd 2>/dev/null
/home/Wassim/Documents/ddupdate/systemd
/home/Wassim/.config/systemd
/run/systemd
/run/udev/tags/systemd
/run/user/1000/systemd
/etc/xdg/systemd
/etc/systemd
/var/lib/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/49/e51263e53d04900556e2f97ac2b27201f632f604d68d67f50323f9a99389fdb0/files/lib/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/49/e51263e53d04900556e2f97ac2b27201f632f604d68d67f50323f9a99389fdb0/files/share/licenses/gnome/systemd
/var/lib/flatpak/runtime/org.gnome.Platform/x86_64/50/a8da766dd0273a67539d2b98358ed6809d8e729280baf63428108837135229d3/files/lib/systemd
<---- output omitted ---->
/var/lib/snapd/snap/gnome-3-38-2004/143/usr/lib/systemd
/usr/lib/systemd
/usr/lib/systemd/systemd
/usr/lib64/systemd
/usr/lib64/python3.12/site-packages/systemd
/usr/share/licenses/systemd
/usr/share/doc/systemd
/usr/share/systemd
/usr/share/cockpit/systemd
Wassim@linux:~$
/run/systemd seem to store runtime unit files, because /run/ typically contains runtime data, so it can not be a permanent location of systemd unit files. There is also /etc/systemd and /usr/lib/systemd/system/. The latter appears to store system units:
Wassim@linux:~$ ls /usr/lib/systemd/system
accounts-daemon.service rpc-statd-notify.service
[email protected] rpc-statd.service
alsa-restore.service rpmdb-migrate.service
alsa-state.service rpmdb-rebuild.service
arp-ethers.service rsyslog.service
atd.service rtkit-daemon.service
auditd.service runlevel0.target
audit-rules.service runlevel1.target
auth-rpcgss-module.service runlevel1.target.wants
[email protected] runlevel2.target
avahi-daemon.service runlevel2.target.wants
avahi-daemon.socket runlevel3.target
basic.target runlevel3.target.wants
basic.target.wants runlevel4.target
blk-availability.service runlevel4.target.wants
[email protected] runlevel5.target
bluetooth.service runlevel5.target.wants
bluetooth.target runlevel6.target
bolt.service 'run-vmblock\x2dfuse.mount'
boot-complete.target selinux-autorelabel-mark.service
brltty.service selinux-autorelabel.service
canberra-system-bootup.service selinux-autorelabel.target
canberra-system-shutdown-reboot.service selinux-check-proper-disable.service
canberra-system-shutdown.service [email protected]
[email protected] setroubleshootd.service
capsule.slice shutdown.target
chronyd-restricted.service sigpwr.target
chronyd.service sleep.target
chrony-wait.service slices.target
cockpit-issue.service smartcard.target
cockpit.service smartd.service
[email protected] snapd.apparmor.service
cockpit-session.socket snapd.mounts-pre.target
cockpit-session-socket-user.service snapd.mounts.target
cockpit.socket snapd.seeded.service
cockpit-wsinstance-http.service snapd.service
[email protected] snapd.socket
cockpit-wsinstance-https-factory.socket sockets.target
cockpit-wsinstance-http.socket sockets.target.wants
[email protected] soft-reboot.target
[email protected] sound.target
cockpit-wsinstance-socket-user.service sound.target.wants
colord.service speech-dispatcherd.service
[email protected] spice-vdagentd.service
console-getty.service spice-vdagentd.socket
containerd.service ssh-access.target
[email protected] [email protected]
crond.service sshd-keygen.target
cryptsetup-pre.target sshd.service
cryptsetup.target [email protected]
ctrl-alt-del.target sshd.socket
cups-browsed.service ssh-host-keys-migration.service
cups.path sssd-autofs.service
cups.service sssd-autofs.socket
cups.service.d sssd-kcm.service
cups.socket sssd-kcm.socket
< ---- output omitted ---- >
Examining the other directories, /etc/systemd/system and /etc/systemd/user/:
user1@rhel10-vm2:~$ ls /etc/systemd/system/
bluetooth.target.wants
ctrl-alt-del.target
dbus-org.bluez.service
dbus-org.fedoraproject.FirewallD1.service
dbus-org.freedesktop.nm-dispatcher.service
dbus.service
default.target
default.target.wants
'dev-virtio\x2dports-org.qemu.guest_agent.0.device.wants'
getty.target.wants
graphical.target.wants
multi-user.target.wants
network-online.target.wants
sockets.target.wants
sysinit.target.wants
timers.target.wants
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$ ls /etc/systemd/user
basic.target.wants pipewire.service.wants sockets.target.wants
dbus.service pipewire-session-manager.service timers.target.wants
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$
Linux unit names are in the form {name.type}.
To list all Linux unit files, regardless of their location in the Linux tree, use systemctl list-unit-files:
user1@rhel10-vm2:~$ systemctl list-unit-file
Unknown command verb 'list-unit-file', did you mean 'list-unit-files'?
user1@rhel10-vm2:~$ systemctl list-unit-files
UNIT FILE STATE PRE>
proc-sys-fs-binfmt_misc.automount static - >
-.mount generated - >
boot.mount generated - >
dev-hugepages.mount static - >
dev-mqueue.mount static - >
proc-sys-fs-binfmt_misc.mount disabled dis>
sys-fs-fuse-connections.mount static - >
sys-kernel-config.mount static - >
sys-kernel-debug.mount static - >
sys-kernel-tracing.mount static - >
tmp.mount disabled dis>
insights-client-results.path disabled dis>
lvm-devices-import.path disabled dis>
systemd-ask-password-console.path static - >
systemd-ask-password-plymouth.path static - >
systemd-ask-password-wall.path static - >
session-1.scope transient - >
arp-ethers.service disabled dis>
atd.service enabled ena>
audit-rules.service enabled ena>
auditd.service enabled ena>
[email protected] alias - >
blk-availability.service disabled dis>
bluetooth.service enabled ena>
bolt.service static - >
[email protected] static - >
<---- output omitted ---->
insights-client-results.service static - >
insights-client.service static - >
irqbalance.service enabled ena>
iscsi-init.service disabled dis>
iscsi-onboot.service enabled ena>
iscsi-shutdown.service static - >
iscsi-starter.service enabled ena>
iscsi.service indirect dis>
<---- output omitted ---->
systemd-remount-fs.service enabled-runtime dis>
systemd-repart.service static - >
systemd-rfkill.service static - >
systemd-soft-reboot.service static - >
systemd-suspend-then-hibernate.service static - >
<---- output omitted ---->
427 unit files listed.
lines 389-430/430 (END)
Units activation state#
Units have a high level activation state called the ACTIVE state. This is not to be confused with being active. In fact, the ACTIVE state encompasses the following operational states:
- active,
- inactive,
- failed,
The ACTIVE state is displayed in the third column of the output of systemctl or systemctl --all. The difference between the two is that:
systemctl --alldisplays all units loaded in memory, no matter in which ACTIVE state they are,systemctldisplays only the units loaded in memory and are in a active or failed operational state.
In the output of systemctl --all, notice the small bulbs at the front of some unit entries; They visually signal some sort of issue with the unit. This visual cue is not found in the output of the systemctl command.
Wassim@linux:~$ systemctl --all
UNIT LOAD ACTIVE SUB DESCRIPTION >
● boot.automount not-found inactive dead boot.automount
proc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File >
dev-disk-by\x2ddiskseq-1.device loaded active plugged Samsung SSD 990 PRO 1TB
dev-disk-by\x2ddiskseq-102.device loaded active plugged /dev/disk/by-diskseq/102
dev-disk-by\x2ddiskseq-14.device loaded active plugged /dev/disk/by-diskseq/14
dev-disk-by\x2ddiskseq-15.device loaded active plugged /dev/disk/by-diskseq/15
dev-disk-by\x2ddiskseq-16.device loaded active plugged /dev/disk/by-diskseq/16
dev-disk-by\x2ddiskseq-17.device loaded active plugged /dev/disk/by-diskseq/17
dev-disk-by\x2ddiskseq-18.device loaded active plugged /dev/disk/by-diskseq/18
<---- output omitted ---->
sys-fs-fuse-connections.mount loaded active mounted FUSE Control File System
sys-kernel-config.mount loaded active mounted Kernel Configuration File >
sys-kernel-debug.mount loaded active mounted Kernel Debug File System
sys-kernel-tracing.mount loaded active mounted Kernel Trace File System
● sysroot.mount not-found inactive dead sysroot.mount
tmp.mount loaded inactive dead Temporary Directory /tmp
var-lib-machines.mount loaded inactive dead Virtual Machine and Contai>
var-lib-nfs-rpc_pipefs.mount loaded active mounted RPC Pipe File System
var-lib-snapd-snap-bare-5.mount loaded active mounted Mount unit for bare, rev
<---- output omitted ---->
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-network-generator.service loaded active exited Generate network units fro>
● systemd-oomd.service not-found inactive dead systemd-oomd.service
<---- output omitted ---->
vboxballoonctrl-service.service loaded active exited vboxballoonctrl-service.se>
● vboxdrv.service loaded failed failed VirtualBox Linux kernel mo>
vboxweb-service.service loaded active exited vboxweb-service.service
<---- output omitted ---->
snapd.mounts-pre.target loaded active active Mounting snaps
snapd.mounts.target loaded active active Mounted snaps
sockets.target loaded active active Socket Units
<---- output omitted ---->
logrotate.timer loaded active waiting Daily rotation of log files
plocate-updatedb.timer loaded active waiting Update the plocate databas>
raid-check.timer loaded active waiting Weekly RAID setup health c>
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary>
unbound-anchor.timer loaded active waiting daily update of the root t>
Legend: 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.
lines 818-860
Wassim@linux:~$ systemctl
UNIT LOAD ACTIVE SUB DESCRIPTION >
proc-sys-fs-binfmt_misc.automount loaded active running Arbitrary Executable File Formats File System Auto>
sys-devices-LNXSYSTM:00-LNXSYBUS:00-MSFT0101:00-tpm-tpm0.device loaded active plugged /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00/t>
sys-devices-LNXSYSTM:00-LNXSYBUS:00-MSFT0101:00-tpmrm-tpmrm0.device loaded active plugged /sys/devices/LNXSYSTM:00/LNXSYBUS:00/MSFT0101:00/t>
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.0-nvme-nvme0-nvme0n1-nvme0n1p1.device loaded active plugged Samsung SSD 990 PRO 1TB EFI\x20System\x20Partition
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.0-nvme-nvme0-nvme0n1-nvme0n1p2.device loaded active plugged Samsung SSD 990 PRO 1TB 2
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.0-nvme-nvme0-nvme0n1-nvme0n1p3.device loaded active plugged Samsung SSD 990 PRO 1TB 3
sys-devices-pci0000:00-0000:00:01.0-0000:01:00.0-nvme-nvme0-nvme0n1.device loaded active plugged Samsung SSD 990 PRO 1TB
sys-devices-pci0000:00-0000:00:0d.0-usb2-2\x2d1-2\x2d1.1-2\x2d1.1:1.0-net-enp0s13f0u1u1.device loaded active plugged RTL8153 Gigabit Ethernet Adapter
sys-devices-pci0000:00-0000:00:0d.0-usb2-2\x2d1-2\x2d1.4-2\x2d1.4:1.0-host2-target2:0:0-2:0:0:0-block-sdb.device loaded active plugged 1081CS0
sys-devices-pci0000:00-0000:00:0d.0-usb2-2\x2d1-2\x2d1.4-2\x2d1.4:1.0-host2-target2:0:0-2:0:0:1-block-sda.device loaded active plugged 1081CS1
sys-devices-pci0000:00-0000:00:0d.2-domain0-0\x2d0.device loaded active plugged /sys/devices/pci0000:00/0000:00:0d.2/domain0/0-0
sys-devices-pci0000:00-0000:00:0d.2-domain0.device loaded active plugged /sys/devices/pci0000:00/0000:00:0d.2/domain0
sys-devices-pci0000:00-0000:00:0d.3-domain1-1\x2d0.device loaded active plugged /sys/devices/pci0000:00/0000:00:0d.3/domain1/1-0
sys-devices-pci0000:00-0000:00:0d.3-domain1.device loaded active plugged /sys/devices/pci0000:00/0000:00:0d.3/domain1
sys-devices-pci0000:00-0000:00:14.0-usb3-3\x2d10-3\x2d10:1.0-bluetooth-hci0.device loaded active plugged /sys/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-1>
sys-devices-pci0000:00-0000:00:14.3-net-wlo1.device loaded active plugged Meteor Lake PCH CNVi WiFi (Wi-Fi 6E AX211 160MHz)
sys-devices-pci0000:00-0000:00:14.3-ptp-ptp1.device loaded active plugged /sys/devices/pci0000:00/0000:00:14.3/ptp/ptp1
sys-devices-pci0000:00-0000:00:1c.0-0000:56:00.0-net-enp86s0.device loaded active plugged Ethernet Controller I226-V
sys-devices-pci0000:00-0000:00:1c.0-0000:56:00.0-ptp-ptp0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1c.0/0000:56:00.0/>
sys-devices-pci0000:00-0000:00:1f.3-sound-card0-controlC0.device loaded active plugged /sys/devices/pci0000:00/0000:00:1f.3/sound/card0/c>
sys-devices-platform-serial8250-serial8250:0-serial8250:0.0-tty-ttyS0.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/seri>
sys-devices-platform-serial8250-serial8250:0-serial8250:0.1-tty-ttyS1.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/seri>
sys-devices-platform-serial8250-serial8250:0-serial8250:0.2-tty-ttyS2.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/seri>
sys-devices-platform-serial8250-serial8250:0-serial8250:0.3-tty-ttyS3.device loaded active plugged /sys/devices/platform/serial8250/serial8250:0/seri>
<---- output omitted ---->
dbus-broker.service loaded active running D-Bus System Message Bus
dkms.service loaded active exited Builds and install new kernel modules through DKMS
docker.service loaded active running Docker Application Container Engine
dracut-shutdown.service loaded active exited Restore /run/initramfs on shutdown
firewalld.service loaded active running firewalld - dynamic firewall daemon
fwupd.service loaded active running Firmware update daemon
<---- output omitted ---->
[email protected] loaded active running User Manager for UID 1000
vboxautostart-service.service loaded active exited vboxautostart-service.service
vboxballoonctrl-service.service loaded active exited vboxballoonctrl-service.service
● vboxdrv.service loaded failed failed VirtualBox Linux kernel module
vboxweb-service.service loaded active exited vboxweb-service.service
<---- output omitted ---->
dm-event.socket loaded active listening Device-mapper event daemon FIFOs
docker.socket loaded active running Docker Socket for the API
iscsid.socket loaded active listening Open-iSCSI iscsid Socket
iscsiuio.socket loaded active listening Open-iSCSI iscsiuio Socket
<---- output omitted ---->
dnf-makecache.timer loaded active waiting dnf makecache --timer
fstrim.timer loaded active waiting Discard unused filesystem blocks once a week
fwupd-refresh.timer loaded active waiting Refresh fwupd metadata regularly
logrotate.timer loaded active waiting Daily rotation of log files
plocate-updatedb.timer loaded active waiting Update the plocate database daily
raid-check.timer loaded active waiting Weekly RAID setup health check
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
unbound-anchor.timer loaded active waiting daily update of the root trust anchor for DNSSEC
Legend: 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.
333 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
~
Wassim@linux:~$
To list loaded units that are in failed operational state:
Wassim@linux:~$ systemctl --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● vboxdrv.service loaded failed failed VirtualBox Linux kernel module
Legend: 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.
1 loaded units listed.
Wassim@linux:~$
The systemctl and systemctl --all commands offer options like -t to allow for specifying the type of the loaded units to display.
Unit dependencies#
To find out, for a specific unit, the ones that are loaded into memory and which it depends on:
Wassim@linux:~$ systemctl list-dependencies auth-rpcgss-module.service
auth-rpcgss-module.service
● ├─gssproxy.service
○ ├─rpc-gssd.service
The output identifies a loaded active unit, gssproxy.service and a loaded inactive unit, rpc-gssd.service.
Unit types#
Target units#
A target is technically a unit. That is why targets might appear in the units filesystem paths. But what makes a target a bit particular is that it encompasses a group of other units to describe a state of the system. Targets are recognizable with the .target file extension.
One target worth mentioning is default.target. This is actually a symlink pointing to whatever target that has been configured with systemctl set-default.
user1@rhel10-vm2:~$ ls -l /etc/systemd/system | grep -E default.target
lrwxrwxrwx. 1 root root 41 Nov 15 2025 default.target -> /usr/lib/systemd/system/multi-user.target
drwxr-xr-x. 2 root root 45 Nov 15 2025 default.target.wants
user1@rhel10-vm2:~$
The same conclusion can be infered with the systemctl get-default command, which displays the value of the target in which the RHEL system boots, aka the boot target:
user1@rhel10-vm2:~$ systemctl get-default
multi-user.target
user1@rhel10-vm2:~$
At Linux boot time, systemd follows the symlink at default.target and loads whatever target is pointed by it.
List all loaded units of type target that are in the active operational state:
user1@rhel10-vm2:~$ systemctl -t target
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
cryptsetup.target loaded active active Local Encrypted Volumes
getty.target loaded active active Login Prompts
integritysetup.target loaded active active Local Integrity Protected Volumes
local-fs-pre.target loaded active active Preparation for Local File Systems
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Preparation for Network
network.target loaded active active Network
nss-user-lookup.target loaded active active User and Group Name Lookups
paths.target loaded active active Path Units
remote-cryptsetup.target loaded active active Remote Encrypted Volumes
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slice Units
sockets.target loaded active active Socket Units
ssh-access.target loaded active active SSH Access Available
sshd-keygen.target loaded active active sshd-keygen.target
swap.target loaded active active Swaps
sysinit.target loaded active active System Initialization
timers.target loaded active active Timer Units
veritysetup.target loaded active active Local Verity Protected Volumes
Legend: 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.
22 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
user1@rhel10-vm2:~$
To display all loaded units of type target, no matter in which ACTIVE state they are, and no matter whether the unit was correctly loaded or not, use the systemctl --all -t target command:
user1@rhel10-vm2:~$ systemctl --all -t target
UNIT LOAD ACTIVE SUB DESCRIPTION >
basic.target loaded active active Basic System
blockdev@dev-disk-by\x2duuid-1cc2a0e5\x2d8ea2\x2d4b31\x2dbbe7\x2da6d47a824276.target loaded inactive dead Block Device Preparation for /dev/disk/by-uuid/1cc2a0e5-8ea2-4b31-bbe7-a6d47>
blockdev@dev-disk-by\x2duuid-543756ba\x2d806e\x2d4129\x2dbc0b\x2d757fb1e4d832.target loaded inactive dead Block Device Preparation for /dev/disk/by-uuid/543756ba-806e-4129-bc0b-757fb>
blockdev@dev-disk-by\x2duuid-aeaf7891\x2dfb70\x2d4df0\x2d90b6\x2dbbd996703b8d.target loaded inactive dead Block Device Preparation for /dev/disk/by-uuid/aeaf7891-fb70-4df0-90b6-bbd99>
blockdev@dev-dm\x2d1.target loaded inactive dead Block Device Preparation for /dev/dm-1
[email protected] loaded inactive dead Block Device Preparation for /dev/vda2
cryptsetup-pre.target loaded inactive dead Local Encrypted Volumes (Pre)
cryptsetup.target loaded active active Local Encrypted Volumes
emergency.target loaded inactive dead Emergency Mode
final.target loaded inactive dead Late Shutdown Services
first-boot-complete.target loaded inactive dead First Boot Complete
getty-pre.target loaded inactive dead Preparation for Logins
getty.target loaded active active Login Prompts
graphical.target loaded inactive dead Graphical Interface
initrd-fs.target loaded inactive dead Initrd File Systems
initrd-root-device.target loaded inactive dead Initrd Root Device
initrd-root-fs.target loaded inactive dead Initrd Root File System
initrd-switch-root.target loaded inactive dead Switch Root
initrd-usr-fs.target loaded inactive dead Initrd /usr File System
initrd.target loaded inactive dead Initrd Default Target
integritysetup.target loaded active active Local Integrity Protected Volumes
local-fs-pre.target loaded active active Preparation for Local File Systems
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
network-online.target loaded active active Network is Online
network-pre.target loaded active active Preparation for Network
network.target loaded active active Network
nss-user-lookup.target loaded active active User and Group Name Lookups
paths.target loaded active active Path Units
remote-cryptsetup.target loaded active active Remote Encrypted Volumes
remote-fs-pre.target loaded inactive dead Preparation for Remote File Systems
remote-fs.target loaded active active Remote File Systems
remote-veritysetup.target loaded inactive dead Remote Verity Protected Volumes
rescue.target loaded inactive dead Rescue Mode
shutdown.target loaded inactive dead System Shutdown
slices.target loaded active active Slice Units
sockets.target loaded active active Socket Units
soft-reboot.target loaded inactive dead Reboot System Userspace
ssh-access.target loaded active active SSH Access Available
● ssh-keygen.target not-found inactive dead ssh-keygen.target
sshd-keygen.target loaded active active sshd-keygen.target
swap.target loaded active active Swaps
sysinit.target loaded active active System Initialization
● syslog.target not-found inactive dead syslog.target
time-set.target loaded inactive dead System Time Set
time-sync.target loaded inactive dead System Time Synchronized
timers.target loaded active active Timer Units
tpm2.target loaded inactive dead Trusted Platform Module
umount.target loaded inactive dead Unmount All Filesystems
veritysetup-pre.target loaded inactive dead Local Verity Protected Volumes (Pre)
veritysetup.target loaded active active Local Verity Protected Volumes
Legend: 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.
51 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
lines 18-59/59 (END)
To change the boot target to another value, use the systemctl set-default command:
user1@localhost:~$ systemctl get-default
graphical.target
user1@localhost:~$ sudo systemctl set-default multi-user.target
[sudo] password for user1:
Removed '/etc/systemd/system/default.target'.
Created symlink '/etc/systemd/system/default.target' → '/usr/lib/systemd/system/multi-user.target'.
user1@localhost:~$
user1@localhost:~$ systemctl get-default
multi-user.target
user1@localhost:~$ systemctl set-default graphical
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ====
Authentication is required to manage system service or unit files.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
Removed '/etc/systemd/system/default.target'.
Created symlink '/etc/systemd/system/default.target' → '/usr/lib/systemd/system/graphical.target'.
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@localhost:~$
user1@localhost:~$ systemctl get-default
graphical.target
user1@localhost:~$
Notice that a reload of the systemd daemon was automatically performed when I changed the default target from multi-user.target to graphical.target. I can also manually reload systemd with systemctl daemon-reload:
user1@rhel10-vm2:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$
Note that a reload of systemd does not impact enabled and running service units I can also manually reload systemd with systemctl daemon-reload:
user1@rhel10-vm2:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$
Note that a reload of systemd does not impact enabled and running service units. Example with firewalld:
user1@rhel10-vm2:~$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-08-22 14:59:37 CEST; 1min 2s ago
Invocation: 5fdb4a00ce014e0eb04175cbcca33403
Docs: man:firewalld(1)
Main PID: 853 (firewalld)
Tasks: 2 (limit: 10680)
Memory: 44.9M (peak: 67.3M)
CPU: 300ms
CGroup: /system.slice/firewalld.service
└─853 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid
Aug 22 14:59:36 rhel10-vm2 systemd[1]: Starting firewalld.service - firewalld - dynamic firewall daemon...
Aug 22 14:59:37 rhel10-vm2 systemd[1]: Started firewalld.service - firewalld - dynamic firewall daemon.
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$ systemctl daemon-reload firewalld
Too many arguments.
user1@rhel10-vm2:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-08-22 14:59:37 CEST; 1min 23s ago
Invocation: 5fdb4a00ce014e0eb04175cbcca33403
Docs: man:firewalld(1)
Main PID: 853 (firewalld)
Tasks: 2 (limit: 10680)
Memory: 44.9M (peak: 67.3M)
CPU: 300ms
CGroup: /system.slice/firewalld.service
└─853 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid
Aug 22 14:59:36 rhel10-vm2 systemd[1]: Starting firewalld.service - firewalld - dynamic firewall daemon...
Aug 22 14:59:37 rhel10-vm2 systemd[1]: Started firewalld.service - firewalld - dynamic firewall daemon.
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-08-22 14:59:37 CEST; 1min 2s ago
Invocation: 5fdb4a00ce014e0eb04175cbcca33403
Docs: man:firewalld(1)
Main PID: 853 (firewalld)
Tasks: 2 (limit: 10680)
Memory: 44.9M (peak: 67.3M)
CPU: 300ms
CGroup: /system.slice/firewalld.service
└─853 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid
Aug 22 14:59:36 rhel10-vm2 systemd[1]: Starting firewalld.service - firewalld - dynamic firewall daemon...
Aug 22 14:59:37 rhel10-vm2 systemd[1]: Started firewalld.service - firewalld - dynamic firewall daemon.
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$ systemctl daemon-reload firewalld
Too many arguments.
user1@rhel10-vm2:~$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-08-22 14:59:37 CEST; 1min 23s ago
Invocation: 5fdb4a00ce014e0eb04175cbcca33403
Docs: man:firewalld(1)
Main PID: 853 (firewalld)
Tasks: 2 (limit: 10680)
Memory: 44.9M (peak: 67.3M)
CPU: 300ms
CGroup: /system.slice/firewalld.service
└─853 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid
Aug 22 14:59:36 rhel10-vm2 systemd[1]: Starting firewalld.service - firewalld - dynamic firewall daemon...
Aug 22 14:59:37 rhel10-vm2 systemd[1]: Started firewalld.service - firewalld - dynamic firewall daemon.
user1@rhel10-vm2:~$
To immediately switch the system from the current target to another, without modifying the default boot target, use the systemctl isolate command:
user1@localhost:~$ systemctl get-default
graphical.target
user1@localhost:~$ systemctl isolate multi-user.target
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to start 'multi-user.target'.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@localhost:~$
user1@localhost:~$ systemctl get-default
graphical.target
user1@localhost:~$
The previously running target unit has been set to the inactive operational state:
user1@localhost:~$ systemctl is-enabled graphical.target
indirect
user1@localhost:~$ systemctl --all -t target | grep -E graphical
graphical.target loaded inactive dead Graphical Interface
user1@localhost:~$
The legacy method to reboot a Linux system was to issue shutdown -r.
user1@localhost:~$ shutdown -r
Failed to schedule shutdown: Interactive authentication required.
user1@localhost:~$ sudo shutdown -r
[sudo] password for user1:
Broadcast message from root@localhost on pts/1 (Sat 2026-08-15 18:19:06 CEST):
The system will reboot at Sat 2026-08-15 18:20:06 CEST!
Reboot scheduled for Sat 2026-08-15 18:20:06 CEST, use 'shutdown -c' to cancel.
user1@localhost:~$ shutdown -c
Failed to talk to logind, shutdown hasn't been cancelled: Interactive authentication required.
user1@localhost:~$ sudo shutdown -c
Broadcast message from root@localhost on pts/1 (Sat 2026-08-15 18:19:14 CEST):
System shutdown has been cancelled
user1@localhost:~$
The modern method for the same purpose is to use systemctl reboot or simply reboot, since reboot is a symlink to systemctl:
user1@localhost:~$ whereis reboot
reboot: /usr/sbin/reboot /usr/share/man/man2/reboot.2.gz /usr/share/man/man8/reboot.8.gz
user1@localhost:~$
user1@localhost:~$ ls -l /usr/sbin/reboot
lrwxrwxrwx. 1 root root 16 Aug 15 2025 /usr/sbin/reboot -> ../bin/systemctl
user1@localhost:~$
The reboot and poweroff commands ask systemd to execute systemctl with the reboot.target and poweroff.target respectively. These target unit files are not loaded in memory; They are waiting for systemd to get loaded:
user1@localhost:~$ systemctl --all -t target | grep -E "reboot.target|poweroff.target"
soft-reboot.target loaded inactive dead Reboot System Userspace
user1@localhost:~$
The soft-reboot.target is not the target unit file I am looking for.
user1@localhost:~$ systemctl list-unit-files | grep -E "reboot.target|poweroff.target"
poweroff.target disabled disabled
reboot.target enabled enabled
soft-reboot.target static -
user1@localhost:~$
Executing systemctl reboot or systemctl poweroff is another way to reboot or power off the Linux system, by instructing systemd to dynamically load the respective target unit.
Target dependencies#
To find out the units on which the targets depends on and the state of each of those units:
Wassim@linux:~$ systemctl list-dependencies
default.target
● ├─accounts-daemon.service
● ├─gdm.service
○ ├─nvmefc-boot-connections.service
● ├─ollama.service
● ├─rtkit-daemon.service
● ├─switcheroo-control.service
○ ├─systemd-update-utmp-runlevel.service
● ├─tuned-ppd.service
● ├─udisks2.service
● ├─upower.service
● └─multi-user.target
● ├─atd.service
○ ├─audit-rules.service
● ├─auditd.service
● ├─avahi-daemon.service
● ├─chronyd.service
● ├─crond.service
● ├─cups.path
● ├─cups.service
● ├─dkms.service
● ├─docker.service
● ├─firewalld.service
● ├─irqbalance.service
● ├─kdump.service
● ├─libstoragemgmt.service
○ ├─libvirtd.service
● ├─lm_sensors.service
<---- output omitted ---->
● ├─var-lib-snapd-snap-vivaldi-453.mount
● ├─var-lib-snapd-snap-vivaldi-455.mount
● ├─vboxautostart-service.service
● ├─vboxballoonctrl-service.service
× ├─vboxdrv.service
● ├─vboxweb-service.service
○ ├─virtqemud.service
○ ├─vmtoolsd.service
● ├─vpnagentd.service
● ├─basic.target
● │ ├─-.mount
● │ ├─paths.target
● │ ├─slices.target
● │ │ ├─-.slice
● │ │ └─system.slice
● │ ├─sockets.target
● │ │ ├─avahi-daemon.socket
● │ │ ├─cockpit.socket
<---- output omitted ---->
○ ├─var-lib-machines.mount
● └─nfs-client.target
○ ├─auth-rpcgss-module.service
● ├─rpc-statd-notify.service
● └─remote-fs-pre.target
lines 203-245/245 (END)
From the output, the following can be for example infered:
- the accounts-daemon.service service unit is loaded in memory and active,
- the nvmefc-boot-connections.service service unit is loaded in memory but not active,
- the multi-user.target target unit is a dependency of the default.target target unit.
Socket units#
There are two types of sockets in Linux: Unix domain sockets and network sockets.
Unix domain sockets are recognized by a notation in the form of a filesystem path.
Network sockets are recognizable by a notation in the form of:
- an IP address and a port number,
- a double column between brackets and a port number.
Active sockets listen for incoming data, either from another local process or from a remote process, the latter typically communicating across a TCP/IP network. These can be displayed with the systemctl list-sockets command.
The items displayed under the first column, LISTEN, are the listening sockets, or simply listeners. They are launched either by systemd or some service. The second column, UNIT, displays the systemd unit file that contains the definition of the socket. The third column, ACTIVATES, indicates which service is activated as soon as the listening socket receives data.
user1@rhel10-vm2:~$ systemctl list-sockets
LISTEN UNIT ACTIVATES
@ISCSIADM_ABSTRACT_NAMESPACE iscsid.socket iscsid.service
@ISCSID_UIP_ABSTRACT_NAMESPACE iscsiuio.socket iscsiuio.service
[::]:9090 cockpit.socket cockpit.service
kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
vsock::22 sshd-vsock.socket -
/dev/rfkill systemd-rfkill.socket systemd-rfkill.service
/run/.heim_org.h5l.kcm-socket sssd-kcm.socket sssd-kcm.service
/run/dbus/system_bus_socket dbus.socket dbus-broker.service
/run/dmeventd-client dm-event.socket dm-event.service
/run/dmeventd-server dm-event.socket dm-event.service
/run/initctl systemd-initctl.socket systemd-initctl.service
/run/lvm/lvmpolld.socket lvm2-lvmpolld.socket lvm2-lvmpolld.service
/run/pcscd/pcscd.comm pcscd.socket pcscd.service
/run/ssh-unix-local/socket sshd-unix-local.socket -
/run/systemd/coredump systemd-coredump.socket -
/run/systemd/io.systemd.BootControl systemd-bootctl.socket -
/run/systemd/io.systemd.Credentials systemd-creds.socket -
/run/systemd/io.systemd.Hostname systemd-hostnamed.socket systemd-hostnamed.service
/run/systemd/io.systemd.sysext systemd-sysext.socket -
/run/systemd/journal/dev-log systemd-journald-dev-log.socket systemd-journald.service
/run/systemd/journal/socket systemd-journald.socket systemd-journald.service
/run/systemd/journal/stdout systemd-journald.socket systemd-journald.service
/run/systemd/userdb/io.systemd.Multiplexer systemd-userdbd.socket systemd-userdbd.service
/run/udev/control systemd-udevd-control.socket systemd-udevd.service
24 sockets listed.
Pass --all to see loaded but inactive sockets, too.
user1@rhel10-vm2:~$
To display all loaded units of type socket, no matter in which ACTIVE state they are, use the systemctl --all -t socket command.
To display the loaded units of type socket that are only in the active operational state, use the systemctl -t socket command.
Wassim@linux:~$ systemctl --all -t socket
UNIT LOAD ACTIVE SUB DESCRIPTION
avahi-daemon.socket loaded active running Avahi mDNS/DNS-SD Stack Activation Socket
cockpit-session.socket loaded inactive dead Initiator socket for Cockpit sessions
cockpit-wsinstance-http.socket loaded inactive dead Socket for Cockpit Web Service http instance
cockpit-wsinstance-https-factory.socket loaded inactive dead Socket for Cockpit Web Service https instance factory
cockpit.socket loaded active listening Cockpit Web Service Socket
cups.socket loaded active running CUPS Scheduler
dbus.socket loaded active running D-Bus System Message Bus Socket
dm-event.socket loaded active listening Device-mapper event daemon FIFOs
docker.socket loaded active running Docker Socket for the API
iscsid.socket loaded active listening Open-iSCSI iscsid Socket
iscsiuio.socket loaded active listening Open-iSCSI iscsiuio Socket
libvirtd-admin.socket loaded inactive dead libvirt legacy monolithic daemon admin socket
libvirtd-ro.socket loaded inactive dead libvirt legacy monolithic daemon read-only socket
libvirtd.socket loaded inactive dead libvirt legacy monolithic daemon socket
lvm2-lvmpolld.socket loaded active listening LVM2 poll daemon socket
multipathd.socket loaded inactive dead multipathd control socket
pcscd.socket loaded active listening PC/SC Smart Card Daemon Activation Socket
rpcbind.socket loaded active running RPCbind Server Activation Socket
snapd.socket loaded active running Socket activation for snappy daemon
sshd-unix-local.socket loaded active listening OpenSSH Server Socket (systemd-ssh-generator, AF_UNIX Local)
sssd-kcm.socket loaded active running SSSD Kerberos Cache Manager responder socket
syslog.socket loaded inactive dead Syslog Socket
systemd-bootctl.socket loaded active listening Boot Entries Service Socket
systemd-coredump.socket loaded active listening Process Core Dump Socket
systemd-creds.socket loaded active listening Credential Encryption/Decryption
systemd-hostnamed.socket loaded active listening Hostname Service Socket
systemd-importd.socket loaded active listening Disk Image Download Service Socket
systemd-initctl.socket loaded active listening initctl Compatibility Named Pipe
systemd-journald-audit.socket loaded inactive dead Journal Audit Socket
systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log)
systemd-journald.socket loaded active running Journal Sockets
systemd-pcrextend.socket loaded inactive dead TPM PCR Measurements
systemd-pcrlock.socket loaded inactive dead Make TPM PCR Policy
systemd-rfkill.socket loaded active listening Load/Save RF Kill Switch Status /dev/rfkill Watch
systemd-sysext.socket loaded active listening System Extension Image Management
systemd-udevd-control.socket loaded active running udev Control Socket
systemd-udevd-kernel.socket loaded active running udev Kernel Socket
systemd-userdbd.socket loaded active running User Database Manager Socket
virtinterfaced-admin.socket loaded active listening libvirt interface daemon admin socket
virtinterfaced-ro.socket loaded active listening libvirt interface daemon read-only socket
virtinterfaced.socket loaded active listening libvirt interface daemon socket
virtlockd-admin.socket loaded active listening libvirt locking daemon admin socket
virtlockd.socket loaded active listening libvirt locking daemon socket
virtlogd-admin.socket loaded active listening libvirt logging daemon admin socket
virtlogd.socket loaded active listening libvirt logging daemon socket
virtnetworkd-admin.socket loaded active listening libvirt network daemon admin socket
virtnetworkd-ro.socket loaded active listening libvirt network daemon read-only socket
virtnetworkd.socket loaded active listening libvirt network daemon socket
virtnodedevd-admin.socket loaded active listening libvirt nodedev daemon admin socket
virtnodedevd-ro.socket loaded active listening libvirt nodedev daemon read-only socket
virtnodedevd.socket loaded active listening libvirt nodedev daemon socket
virtnwfilterd-admin.socket loaded active listening libvirt nwfilter daemon admin socket
virtnwfilterd-ro.socket loaded active listening libvirt nwfilter daemon read-only socket
virtnwfilterd.socket loaded active listening libvirt nwfilter daemon socket
virtproxyd-admin.socket loaded active listening libvirt proxy daemon admin socket
virtproxyd-ro.socket loaded active listening libvirt proxy daemon read-only socket
virtproxyd.socket loaded active listening libvirt proxy daemon socket
virtqemud-admin.socket loaded active listening libvirt QEMU daemon admin socket
virtqemud-ro.socket loaded active listening libvirt QEMU daemon read-only socket
virtqemud.socket loaded active listening libvirt QEMU daemon socket
virtsecretd-admin.socket loaded active listening libvirt secret daemon admin socket
virtsecretd-ro.socket loaded active listening libvirt secret daemon read-only socket
virtsecretd.socket loaded active listening libvirt secret daemon socket
virtstoraged-admin.socket loaded active listening libvirt storage daemon admin socket
virtstoraged-ro.socket loaded active listening libvirt storage daemon read-only socket
virtstoraged.socket loaded active listening libvirt storage daemon socket
Legend: 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.
66 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
lines 32-74/74 (END)
Wassim@linux:~$ systemctl -t socket
UNIT LOAD ACTIVE SUB DESCRIPTION
avahi-daemon.socket loaded active running Avahi mDNS/DNS-SD Stack Activation Socket
cockpit.socket loaded active listening Cockpit Web Service Socket
cups.socket loaded active running CUPS Scheduler
dbus.socket loaded active running D-Bus System Message Bus Socket
dm-event.socket loaded active listening Device-mapper event daemon FIFOs
docker.socket loaded active running Docker Socket for the API
iscsid.socket loaded active listening Open-iSCSI iscsid Socket
iscsiuio.socket loaded active listening Open-iSCSI iscsiuio Socket
lvm2-lvmpolld.socket loaded active listening LVM2 poll daemon socket
pcscd.socket loaded active listening PC/SC Smart Card Daemon Activation Socket
rpcbind.socket loaded active running RPCbind Server Activation Socket
snapd.socket loaded active running Socket activation for snappy daemon
sshd-unix-local.socket loaded active listening OpenSSH Server Socket (systemd-ssh-generator, AF_UNIX Local)
sssd-kcm.socket loaded active running SSSD Kerberos Cache Manager responder socket
systemd-bootctl.socket loaded active listening Boot Entries Service Socket
systemd-coredump.socket loaded active listening Process Core Dump Socket
systemd-creds.socket loaded active listening Credential Encryption/Decryption
systemd-hostnamed.socket loaded active listening Hostname Service Socket
systemd-importd.socket loaded active listening Disk Image Download Service Socket
systemd-initctl.socket loaded active listening initctl Compatibility Named Pipe
systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log)
systemd-journald.socket loaded active running Journal Sockets
systemd-rfkill.socket loaded active listening Load/Save RF Kill Switch Status /dev/rfkill Watch
systemd-sysext.socket loaded active listening System Extension Image Management
systemd-udevd-control.socket loaded active running udev Control Socket
systemd-udevd-kernel.socket loaded active running udev Kernel Socket
systemd-userdbd.socket loaded active running User Database Manager Socket
virtinterfaced-admin.socket loaded active listening libvirt interface daemon admin socket
virtinterfaced-ro.socket loaded active listening libvirt interface daemon read-only socket
virtinterfaced.socket loaded active listening libvirt interface daemon socket
virtlockd-admin.socket loaded active listening libvirt locking daemon admin socket
virtlockd.socket loaded active listening libvirt locking daemon socket
virtlogd-admin.socket loaded active listening libvirt logging daemon admin socket
virtlogd.socket loaded active listening libvirt logging daemon socket
virtnetworkd-admin.socket loaded active listening libvirt network daemon admin socket
virtnetworkd-ro.socket loaded active listening libvirt network daemon read-only socket
virtnetworkd.socket loaded active listening libvirt network daemon socket
virtnodedevd-admin.socket loaded active listening libvirt nodedev daemon admin socket
virtnodedevd-ro.socket loaded active listening libvirt nodedev daemon read-only socket
virtnodedevd.socket loaded active listening libvirt nodedev daemon socket
virtnwfilterd-admin.socket loaded active listening libvirt nwfilter daemon admin socket
virtnwfilterd-ro.socket loaded active listening libvirt nwfilter daemon read-only socket
virtnwfilterd.socket loaded active listening libvirt nwfilter daemon socket
virtproxyd-admin.socket loaded active listening libvirt proxy daemon admin socket
virtproxyd-ro.socket loaded active listening libvirt proxy daemon read-only socket
virtproxyd.socket loaded active listening libvirt proxy daemon socket
virtqemud-admin.socket loaded active listening libvirt QEMU daemon admin socket
virtqemud-ro.socket loaded active listening libvirt QEMU daemon read-only socket
virtqemud.socket loaded active listening libvirt QEMU daemon socket
virtsecretd-admin.socket loaded active listening libvirt secret daemon admin socket
virtsecretd-ro.socket loaded active listening libvirt secret daemon read-only socket
virtsecretd.socket loaded active listening libvirt secret daemon socket
virtstoraged-admin.socket loaded active listening libvirt storage daemon admin socket
virtstoraged-ro.socket loaded active listening libvirt storage daemon read-only socket
virtstoraged.socket loaded active listening libvirt storage daemon socket
Legend: 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.
55 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.
lines 21-63/63 (END)
To spot the difference in the output of both commands, I pipe wc -l in the output of systemctl. Bare in mind that, when piping the wc -l command directly after a systemctl command, the legend lines in the output of systemctl will be counted too, which defeats the purpose.
Wassim@linux:~$ systemctl -t socket | grep -E 'listed'
55 loaded units listed. Pass --all to see loaded but inactive units, too.
Wassim@linux:~$
Wassim@linux:~$ systemctl --all -t socket | grep -E 'listed'
66 loaded units listed.
Wassim@linux:~$
Wassim@linux:~$ systemctl --all -t socket | grep -E 'inactive'
cockpit-session.socket loaded inactive dead Initiator socket for Cockpit sessions
cockpit-wsinstance-http.socket loaded inactive dead Socket for Cockpit Web Service http instance
cockpit-wsinstance-https-factory.socket loaded inactive dead Socket for Cockpit Web Service https instance factory
libvirtd-admin.socket loaded inactive dead libvirt legacy monolithic daemon admin socket
libvirtd-ro.socket loaded inactive dead libvirt legacy monolithic daemon read-only socket
libvirtd.socket loaded inactive dead libvirt legacy monolithic daemon socket
multipathd.socket loaded inactive dead multipathd control socket
syslog.socket loaded inactive dead Syslog Socket
systemd-journald-audit.socket loaded inactive dead Journal Audit Socket
systemd-pcrextend.socket loaded inactive dead TPM PCR Measurements
systemd-pcrlock.socket loaded inactive dead Make TPM PCR Policy
Wassim@linux:~$
Wassim@linux:~$ systemctl --all -t socket | grep -E 'inactive' | wc -l
11
Wassim@linux:~$
There are 55 loaded socket units in the active operational state as shown in the output of systemctl -t socket | grep -E 'listed'. And there are 11 loaded socket units that are in the inactive operational state, as shown in the output of systemctl --all -t socket | grep -E 'inactive' | wc -l. Adding 55 to 11 gives a total of 66 loaded socket units, which matches the number of loaded socket units shown in the output of systemctl --all -t socket | grep -E 'listed'.
Service units#
Service units are unit files that have the .service extension. To find out the state of a service unit:
user1@rhel10-vm2:~$ systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; preset: enabled)
Active: active (running) since Fri 2026-08-14 19:14:21 CEST; 2h 8min ago
Invocation: 6cd3b0e83608401aba0ebfbcb2a468a4
Docs: man:firewalld(1)
Main PID: 849 (firewalld)
Tasks: 2 (limit: 10680)
Memory: 46.5M (peak: 67.3M)
CPU: 304ms
CGroup: /system.slice/firewalld.service
└─849 /usr/bin/python3 -sP /usr/sbin/firewalld --nofork --nopid
Aug 14 19:14:20 rhel10-vm2 systemd[1]: Starting firewalld.service - firewalld - dynamic firewall daemon...
Aug 14 19:14:21 rhel10-vm2 systemd[1]: Started firewalld.service - firewalld - dynamic firewall daemon.
user1@rhel10-vm2:~$
The first line in the output is the same description found in the service unit file in the /usr/lib/systemd/system/ filesystem path. The exact service unit file location is displayed in the second line of the output:
user1@rhel10-vm2:~$ head -n 2 /usr/lib/systemd/system/firewalld.service
[Unit]
Description=firewalld - dynamic firewall daemon
user1@rhel10-vm2:~$
The second line of the output also displays whether the service unit was correctly loaded and whether it is enabled at system boot. The third line of the same output displays the operational state of the service unit. This information can also be found using systemctl list-units:
user1@rhel10-vm2:~$ systemctl list-units | grep -E firewalld
firewalld.service loaded active running firewalld - dynamic firewall daemon
user1@rhel10-vm2:~$
Service units can be disabled and enabled with systemctl disable and systemctl enable respectively, which means that the service unit will be disabled or enabled at system boot:
user1@rhel10-vm2:~$ systemctl disable firewalld.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ====
Authentication is required to manage system service or unit files.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
Removed '/etc/systemd/system/multi-user.target.wants/firewalld.service'.
Removed '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'.
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$ systemctl is-enabled firewalld.service
disabled
user1@rhel10-vm2:~$ systemctl is-active firewalld
active
user1@rhel10-vm2:~$ systemctl enable firewalld.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ====
Authentication is required to manage system service or unit files.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
Created symlink '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service' → '/usr/lib/systemd/system/firewalld.service'.
Created symlink '/etc/systemd/system/multi-user.target.wants/firewalld.service' → '/usr/lib/systemd/system/firewalld.service'.
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$ systemctl is-enabled firewalld.service
enabled
user1@rhel10-vm2:~$
Another method to read the content of the unit file related to the service is to combine cat with systemctl:
user1@rhel10-vm2:~$ systemctl cat firewalld.service
# /usr/lib/systemd/system/firewalld.service
[Unit]
Description=firewalld - dynamic firewall daemon
Before=network-pre.target
Wants=network-pre.target
After=dbus.service
After=polkit.service
Conflicts=iptables.service ip6tables.service ebtables.service ipset.service
Documentation=man:firewalld(1)
[Service]
EnvironmentFile=-/etc/sysconfig/firewalld
ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS
ExecStartPost=/usr/bin/firewall-cmd --state
# don't fail ExecStartPost on RUNNING_BUT_FAILED
SuccessExitStatus=251
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=null
StandardError=null
Type=dbus
BusName=org.fedoraproject.FirewallD1
KillMode=mixed
DevicePolicy=closed
KeyringMode=private
LockPersonality=yes
MemoryDenyWriteExecute=yes
PrivateDevices=yes
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=no
ProtectKernelTunables=no
ProtectSystem=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
[Install]
WantedBy=multi-user.target
Alias=dbus-org.fedoraproject.FirewallD1.service
lines 1-42/42 (END)
To restart a service unit:
user1@rhel10-vm2:~$ systemctl restart firewalld
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to restart 'firewalld.service'.
Authenticating as: user1
Password:
==== AUTHENTICATION COMPLETE ====
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$ systemctl is-active firewalld.service
active
user1@rhel10-vm2:~$
Notice that it was not mandatory to type the whole name of the service unit; It was sufficient to type the first portion of the unit name.
Masking a service unit#
Masking a service unit neither disables nor stops a service unit. It merely block any operations on it unless unmasked.
Example: Masking the firewalld service unit:
user1@rhel10-vm2:~$ sudo systemctl mask firewalld
Created symlink '/etc/systemd/system/firewalld.service' → '/dev/null'.
user1@rhel10-vm2:~$
No more operations are possible on the service unit:
user1@rhel10-vm2:~$ sudo systemctl restart firewalld
Failed to restart firewalld.service: Unit firewalld.service is masked.
user1@rhel10-vm2:~$
Unmasking it and performing regular operations on the service:
user1@rhel10-vm2:~$ sudo systemctl unmask firewalld
Removed '/etc/systemd/system/firewalld.service'.
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$ sudo systemctl restart firewalld
user1@rhel10-vm2:~$
user1@rhel10-vm2:~$