Systemd is a system and service manager for linux operating system . It is the first process that start at boot . It is designed in such way that it start processes in parallel, thus reducing the boot time and computational overhead. It introduce the concept of Systemd units. These units are represented by the units configuration file located in directory in linux. In this article i will explain how to change runlevels in systemd.

In unix like system such as linux , there are many runlevel. These runlevel is responsible for different –  different services started or stopped . Now i going to give a short overview of these runlevels one by one.

Runlevels –      

  • runlevel0.target  is symbolically linked to poweroff.target
  • runlevel1.target is symbolically linked to rescue.target
  • runlevel2.target is symbolically linked to multi-user.target
  • runlevel3.target is symbolically linked to multi-user.target
  • runlevel4.target is symbolically linked to multi-user.target
  • runlevel5.target is symbolically linked to graphical.target
  • runlevel6.target is symbolically linked to reboot.target

Targets are the group of units, which called together to start a target. For example graphical.target call all units which is necessary to start a workstation with graphical interface.

Default runlevel previously set in /etc/inittab but now it is replaced by defaul.target . The location of default.target is /etc/systemd/system/default.target , which is linked to multi-user.target by default .

The /etc/inittab file is used in rhel6 and earlier to pint the initialization files in linux.

View current runlevel in linux –

To view the current runlevel in linux , use command given below –

To set the default target , run the command given below –

How to Change Runlevels (Targets) in Systemd

While system is running, you can switch the target . There are some example given below-

To switch the runlevel3 , run the command given below

To switch the runlevel5 , run the command given below

You may also like to read following article :

Through this topics i explained how to change runlevel (target) in systemd.