Beginners Guide to systemd Targets (Runlevels)

What is a systemd Target

In SysVinit systems, you had a defined but configurable set of runlevels numbered from 0 to 6. A runlevel is essentially a set of capabilities or running services that you can predefine and set the system to boot to so you have a predictable set of services.

In systemd, targets are the new runlevels. For example, the file is typically a symbolic link to another target file such as the file. Targets directly correspond to the SysVinit runlevels in that you can match them up as shown below:

Runlevel Target File What it does?
0 Shuts down and power offs the system
1 rescue.traget Configures a rescue shell session
2 Sets the system to non-graphical multi-user system, typically with no network services
3 Sets the system to non-graphical multi-user system with network services
4 Sets the system to non-graphical multi-user system with network services
5 Sets the system to graphical multi-user system with network services
6 Shuts down and boots the system again

Selecting a systemd Target

A **systemd **target is a set of **systemd **units that should be started to reach a desired state. Important targets are listed in the following table.

TARGET PURPOSE System supports multiple users, graphical and text-based logins. System supports multiple users, text-based logins only sulogin prompt, basic system initialization completed
emergency.targe sulogin prompt, initramfs pivot complete and system root mounted on / read-only.

It is possible for a target to be a part of another target; for example, the ** **includes, which in turn depends on and others. These dependencies can be viewed from the command line with the following command:

# systemctl list-dependencies | grep target

An overview of all available targets can be viewed with:

# systemctl list-units --type=target --all

An overview of all targets installed on disk can be viewed with:

# systemctl list-unit-files --type=target

Selecting a target at runtime

On a running system, administrators can choose to switch to a different target using the systemctl isolate command; for example,** systemctl isolate**

Note: Not all targets can be isolated. Only targets that have **AllowIsolate=yes **set in their unit files can be isolated; for example, the target can be isolated, but the target cannot

Setting a default target

When the system starts, and control is passed over to **systemd **from the **initramfs, systemd **will try to activate the ** **target. Normally the ** **target will be a symbolic link (in /etc/systemd/system/) to either or

The** systemctl **tool provides two commands to manage the link: get-default and setdefault.

# systemctl get-default
# systemctl set-default
rm '/etc/systemd/system/'
ln -s '/usr/lib/systemd/system/' '/etc/systemd/system/'
# systemctl get-default

Selecting a different target at boot time

To select a different target at boot time, a special option can be appended to the kernel command line from the boot loader: systemd.unit=. For example, to boot the system into a rescue shell, pass the following option at the interactive boot loader menu:


To use this method of selecting a different target, use the following procedure for Red Hat Enterprise Linux 7 systems:

  1. (Re)boot the system.
  2. Interrupt the boot loader menu countdown by pressing any key.
  3. Move the cursor to the entry to be started.
  4. Press e to edit the current entry.
  5. Move the cursor to the line that starts with** linux16.** This is the kernel command line.
  6. Append
  7. Press **Ctrl+x **to boot with these changes.