At boot time, when systemd starts the services, it reports reached targets like this in the journal:
journalctl -b --facility=daemon | fgrep 'systemd[1]: Reached'
May 01 10:17:05 xs systemd[1]: Reached target Initrd /usr File System.
May 01 10:17:05 xs systemd[1]: Reached target Slice Units.
May 01 10:17:05 xs systemd[1]: Reached target Swaps.
I created an ordered list of all active targets on my system by manually adding line numbers:
$ journalctl -b --facility=daemon | fgrep 'systemd[1]: Reached' | cut -c46- | tr -d '.'
01 Initrd /usr File System
02 Slice Units
03 Swaps
04 Timer Units
05 Socket Units
06 Path Units
07 Initrd Root Device
08 Preparation for Local File Systems
09 Local File Systems
10 System Initialization
11 Basic System
12 Preparation for Remote File Systems
13 Remote File Systems
14 Initrd Root File System
15 Initrd File Systems
16 Initrd Default Target
17 Switch Root
18 Preparation for Local File Systems = 08
19 Local File Systems = 09
20 Swaps = 03
21 Sound Card
22 System Initialization = 10
23 Path Units = 06
24 Socket Units = 05
25 Basic System = 11
26 Preparation for Network
27 Network
28 Network is Online
29 Login Prompts
30 Multi-User System
31 System Time Synchronized
32 Timer Units = 04
Question 1: Why do a couple of targets get reported twice?
For your convenience, I’ve added the line number of the first occurence at the end, e.g. “18 Preparation for Local File Systems = 08
” means that this target was first reached at position 8 and then again at position 18 of all reported reached goals.
Next, I produced a list of all available targets (the output is shortened at * for better readability):
$ systemctl list-units --type target --all
UNIT LOAD ACTIVE SUB DESCRIPTION
basic.target loaded active active Basic System
blockdev@dev-disk*.target loaded inactive dead Block Device Preparation
blockdev@dev-disk*.target loaded inactive dead Block Device Preparation
blockdev@dev-sda2.target loaded inactive dead Block Device Preparation for /dev/sda2
blockdev@dev-sda3.target loaded inactive dead Block Device Preparation for /dev/sda3
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
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
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-lookup.target loaded inactive dead Host and Network Name Lookups
nss-user-lookup.target loaded inactive dead User and Group Name Lookups
● openvpn.target not-found inactive dead openvpn.target
paths.target loaded active active Path Units
remote-cryptsetup.target loaded inactive dead 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
sound.target loaded active active Sound Card
swap.target loaded active active Swaps
sysinit.target loaded active active System Initialization
time-set.target loaded active active System Time Set
time-sync.target loaded active active System Time Synchronized
timers.target loaded active active Timer Units
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
● wg-quick.target not-found inactive dead wg-quick.target
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.
46 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
As you may see, the description in the last column is the same like the one which systemd reports as reached target in the journal. So I looked up each of the reported reached targets and entered its line number at the beginning of the line. For all remaining targets, I entered non-numeric line numbers to be able to sort the table. For better readability, I splitted the table into two parts:
a) targets reported as reached in the journal (no surprise here):
00 UNIT LOAD ACTIVE SUB DESCRIPTION
01 initrd-usr-fs.target loaded inactive dead Initrd /usr File System
02 slices.target loaded active active Slice Units
03 swap.target loaded active active Swaps
04 timers.target loaded active active Timer Units
05 sockets.target loaded active active Socket Units
06 paths.target loaded active active Path Units
07 initrd-root-device.target loaded inactive dead Initrd Root Device
08 local-fs-pre.target loaded active active Preparation for Local File Systems
09 local-fs.target loaded active active Local File Systems
10 sysinit.target loaded active active System Initialization
11 basic.target loaded active active Basic System
12 remote-fs-pre.target loaded inactive dead Preparation for Remote File Systems
13 remote-fs.target loaded active active Remote File Systems
14 initrd-root-fs.target loaded inactive dead Initrd Root File System
15 initrd-fs.target loaded inactive dead Initrd File Systems
16 initrd.target loaded inactive dead Initrd Default Target
17 initrd-switch-root.target loaded inactive dead Switch Root
21 sound.target loaded active active Sound Card
26 network-pre.target loaded active active Preparation for Network
27 network.target loaded active active Network
28 network-online.target loaded active active Network is Online
29 getty.target loaded active active Login Prompts
30 multi-user.target loaded active active Multi-User System
31 time-sync.target loaded active active System Time Synchronized
b) targets which have not been reported during startup:
00 UNIT LOAD ACTIVE SUB DESCRIPTION
0a blockdev@dev-disk*.target loaded inactive dead Block Device Preparation
0b blockdev@dev-disk*.target loaded inactive dead Block Device Preparation
0c blockdev@dev-sda2.target loaded inactive dead Block Device Preparation for /dev/sda2
0d blockdev@dev-sda3.target loaded inactive dead Block Device Preparation for /dev/sda3
0e cryptsetup-pre.target loaded inactive dead Local Encrypted Volumes (Pre)
0f cryptsetup.target loaded active active Local Encrypted Volumes
1a emergency.target loaded inactive dead Emergency Mode
1b rescue.target loaded inactive dead Rescue Mode
2a getty-pre.target loaded inactive dead Preparation for Logins
3b time-set.target loaded active active System Time Set
3c remote-cryptsetup.target loaded inactive dead Remote Encrypted Volumes
3d nss-lookup.target loaded inactive dead Host and Network Name Lookups
3e nss-user-lookup.target loaded inactive dead User and Group Name Lookups
3f veritysetup-pre.target loaded inactive dead Local Verity Protected Volumes (Pre)
3g veritysetup.target loaded active active Local Verity Protected Volumes
3h remote-veritysetup.target loaded inactive dead Remote Verity Protected Volumes
3i wg-quick.target not-found inactive dead wg-quick.target
3j openvpn.target not-found inactive dead openvpn.target
3k graphical.target loaded inactive dead Graphical Interface
3l first-boot-complete.target loaded inactive dead First Boot Complete
9a umount.target loaded inactive dead Unmount All Filesystems
9b shutdown.target loaded inactive dead System Shutdown
Obviously, the graphical.target
is in this list because of the default runlevel (3) of my system.
There are three targets in this list which are listed as loaded and active but cannot be found in the journal:
- cryptsetup.target
- time-set.target
- veritysetup.target
Question 2: Why do these get reported as loaded and active? I neither have set up encryption nor did I install any Verity software.
Question 3: Why do targets get delivered for software that is not even installed like Verity, OpenVPN, and WireGuard? (And why only for those products and not for other common software?)
As a last remark, the only target that is being mentioned as reached when shutting down the machine for systemd[1]
is the shutdown.target
; the umount.target
is not being reported.