Since CentOS 7 / RHEL 7, system run levels are replaced with targets and are managed by systemd. Systemd targets are represented by target units and their configuration files end with .target extension.
This systemd target unit file contains other systemd units through a chain of dependencies. For example, the graphical.target which provides graphical console starts GNOME service (gdm.service) and activates the multi-user.target unit.
In this guide, we will see how to change the current/default runlevel in CentOS 8 / RHEL 8.
Available Targets / Runlevels
CentOS 8 / RHEL 8 comes with a number of predefined targets that are more or less similar to the standard set of runlevels found in CentOS 7/ RHEL 7.
| ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Change Default RunlevelThe default runlevel can be set either by using the systemctl command or making a symbolic link of runlevel targets to the default.target file. 1. Using systemctl Command 2. Making Symbolic link of runlevel targets Using systemctl CommandLet’s check the current run level by running the following command # systemctl get-default Output: graphical.target The above output confirms that the system’s current default runlevel is graphical.target (runlevel 5). To change the default runlevel to runlevel 3 (nothing but a multi-user.target), use the below command. # systemctl set-default multi-user.target Now reboot the system with the command # reboot To revert to graphical.target login as root and type the command belog: # systemctl set-default graphical.target again reboot the system. Now you are in graphical console. Check it out using the following command in terminal again: # systemctl get-default
| ||||||||||||||||||||||||||
0 comments:
Post a Comment