Systemd runlevels

Written by Robert -

Most Linux users know about runlevels. I've written about those before. If you require to use systemd, you can still use runlevels. Luckily it's easy to understand:

List of runlevels

| run level | systemd target |

| 0 | poweroff.target |

| 1 | rescue.target |

| 3 | multi-user.target |

| 5 | graphical.target |

| 6 | reboot.target |

| emergency | emergency.target |

Current runlevel

You can find out the current runlevel by using the following command:

systemctl get-default

Changing the runlevel

First let's focus on temporary changes. We can change the current runlevel by using the isolate option. Let's make an example. Here To change a runlevel, for example to the commonly used runlevel 3, you can use systemctl:

systemctl isolate multi-user.target

This can also be used to poweroff the computer:

systemctl isolate poweroff.target

To change this permanently, you need to change the link of default.target to the new target. Here I'm going to change it to runlevel 3 or multi-user.target:

ln -sf /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target

That's how you change it.

Comments