Chapter 14. Working with systemd targets

systemd targets are represented by target units. Target units file ends with the .target file extension and their only purpose is to group together other systemd units through a chain of dependencies. For example, the unit, which is used to start a graphical session, starts system services such as the GNOME Display Manager (gdm.service) or Accounts Service (accounts-daemon.service) and also activates the unit. Similarly, the unit starts other essential system services such as NetworkManager (NetworkManager.service) or D-Bus (dbus.service) and activates another target unit named

This section includes procedures to implement while working with systemd targets.

14.1. Difference between SysV runlevels and systemd targets

The previous versions of Red Hat Enterprise Linux were distributed with SysV init or Upstart, and implemented a predefined set of runlevels that represented specific modes of operation. These runlevels were numbered from 0 to 6 and were defined by a selection of system services to be run when a particular runlevel was enabled by the system administrator. Starting with Red Hat Enterprise Linux 7, the concept of runlevels has been replaced with systemd targets.

Red Hat Enterprise Linux 7 was distributed with a number of predefined targets that are more or less similar to the standard set of runlevels from the previous releases. For compatibility reasons, it also provides aliases for these targets that directly maps to the SysV runlevels.

The following table provides a complete list of SysV runlevels and their corresponding systemd targets:

Table 14.1. Comparison of SysV runlevels with systemd targets

RunlevelTarget UnitsDescription


Shut down and power off the system.


Set up a rescue shell.


Set up a non-graphical multi-user system.


Set up a non-graphical multi-user system.


Set up a non-graphical multi-user system.


Set up a graphical multi-user system.


Shut down and reboot the system.

The following table compares the SysV init commands with systemctl. Use the systemctl utility to view, change, or configure systemd targets:


The runlevel and telinit commands are still available in the system and work as expected, but are only included for compatibility reasons and should be avoided.

Table 14.2. Comparison of SysV init commands with systemctl

Old CommandNew CommandDescription


systemctl list-units --type target

Lists currently loaded target units.

telinit runlevel

systemctl isolate

Changes the current target.

Additional resources

  • man sysv init
  • man upstart init
  • man systemctl

14.2. Viewing the default target

The default target unit is represented by the /etc/systemd/system/ file.


  • To determine which target unit is used by default:

    $ systemctl get-default
  • To determine the default target using the symbolic link:

    $  ls -l /usr/lib/systemd/system/

    = Viewing the target units

By default, the systemctl list-units command displays only active units.


  • To list all loaded units regardless of their state:

    $ systemctl list-units --type target --all
  • To list all currently loaded target units:

    $ systemctl list-units --type target
    UNIT                  LOAD   ACTIVE SUB    DESCRIPTION          loaded active active Basic System     loaded active active Encrypted Volumes          loaded active active Login Prompts      loaded active active Graphical Interface   loaded active active Local File Systems (Pre)       loaded active active Local File Systems     loaded active active Multi-User System        loaded active active Network          loaded active active Paths      loaded active active Remote File Systems        loaded active active Sockets          loaded active active Sound Card loaded active active Agent daemon for Spice guests           loaded active active Swap        loaded active active System Initialization      loaded active active System Time Synchronized         loaded active active Timers
    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.
    17 loaded units listed.

14.2.1. Changing the default target

The default target unit is represented by the /etc/systemd/system/ file. The following procedure describes how to change the default target by using the systemctl command:


  1. To determine the default target unit:

    # systemctl get-default
  2. To configure the system to use a different target unit by default:

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

    This command replaces the /etc/systemd/system/ file with a symbolic link to /usr/lib/systemd/system/, where name is the name of the target unit you want to use. Replace multi-user with the name of the target unit you want to use by default.

  3. Reboot

    # reboot