5

systemd still maintains the general idea of runlevels with its "Targets", but how do I change the system runlevel through systemd?

I want to do something equivalent to the old init-script method of:

init 3 # Multi-user
init 5 # Graphical
palswim
  • 4,919
  • 6
  • 37
  • 53
  • That's because you are looking for something that in the systemd world is obsolete. [Forget about runlevels](http://jdebp.eu./FGA/run-levels-are-history.html), as I said in an answer to that very question. – JdeBP Feb 02 '19 at 00:50
  • Questions in other Answers are exactly what "Duplicates" are for. – Jeff Schaller Feb 05 '19 at 16:10
  • Yes, the answer for [that Question](https://unix.stackexchange.com/q/158872/13308) would have answered this Question, but the Question itself was different. – palswim Feb 05 '19 at 18:13

1 Answers1

8

From freedesktop.org's own systemd FAQ, to change the (running) Target (system runlevel), use systemctl isolate TARGET.target:

systemctl isolate multi-user.target # or runlevel3.target
systemctl isolate graphical.target # or runlevel5.target

To change the default Target (default system runlevel, for the next reboot), use systemctl set-default TARGET:

systemctl set-default multi-user.target
systemctl set-default graphical.target
palswim
  • 4,919
  • 6
  • 37
  • 53