runlevel & target
runlevel is specific to Sys V init process. The SysV init runlevel system provides a standard process for controlling which programs init launches or halts when initializing a runlevel. SysV init was chosen because it is easier to use and more flexible than the traditional BSD-style init process (Before RHEL 7 RedHat). As of RHEL 7 onwards, the SysVinit system has been replaced in favor of systemd. The systemd init daemon is the system and service manager. The systemd init daemon does not support runlevel the way Sys V init did. It uses target unit instead, which works like runlevel but differently.
target unit plays a role like the the role played by Sys V init runlevel . The distinguish between them is systemd int daemon can activate more than one target at a time. In other words, it allows the system running in more than one "runlevels". Sys V init only allows the system running in a single runlevel at a time.
*runlevel vstarget unit*
Sys V Init runlevel | systemd target unit 2 | Function&Description |
---|---|---|
0 | runlevel0.target -> poweroff.target | Text |
1 or S | runlevel1.target -> rescure.target | Text |
2, 3, 4 | runlevel2.target, runlevel3.target, runlevel4.target -> poweroff.target | Text |
5 | runlevel5.target -> graphical.target | Text |
6 | runlevel6.target -> reboot.target | Text |
emergency.target | Text |