Target units are used for grouping and ordering other units. systemd manages starting several related process at the same time with the help of target units. Some targets, such as multi-user.target, define a specific state of the system and can be considered as more robust and flexible equivalents of SysV runlevels. At the same time, other targets do not offer any additional functionality except grouping units to manage dependencies effectively. The target unit configuration files are stored in the /usr/lib/systemd/system directory.
The following table lists important targets, along with their equivalent runlevels and their descriptions:
Equivalent runlevel |
Target unit |
Description |
0 |
poweroff.target |
Shuts down and powers off the system |
1 |
rescue.target |
Sulogin prompt with basic system initialization |
2, 3, 4 |
multi-user.target |
Non-graphical multi-user text-based login only |
5 |
Graphical.target |
Graphical multi-user and text-based login |
6 |
Reboot.target |
Shuts down and reboots system |
Some targets are part of another target: graphical.target includes multi-user.target, which in its turn depends on basic.target and others. We can view these dependencies from the command line by executing the command line shown in the following screenshot:
We can view the available targets that are currently loaded on the running system by using the following command line:
# systemctl list-units --type=target --all
We can view all the targets that are installed on the system by using the following command line:
# systemctl list-unit-files --type=target --all