The system configuration file named /etc/inittab is commonly used to set the default runlevel. This file contains information about the initialization process of the system, and it defines the default runlevel, the available runlevels, and the actions to be taken when entering or leaving a runlevel. The default runlevel is the mode of operation that the system starts up into, and it determines which services and processes are running. The default runlevel is specified by a line similar to the following in the /etc/inittab file:
id:5:initdefault:
The number after the first colon indicates the default runlevel, which can range from 0 to 6. The meaning of each runlevel is:
0 — Halt
1 — Single-user text mode
2 — Not used (user-definable)
3 — Full multi-user text mode
4 — Not used (user-definable)
5 — Full multi-user graphical mode (with an X-based login screen)
6 — Reboot
To change the default runlevel, edit the /etc/inittab file as root and change the number to the desired runlevel. For example, to change the default runlevel to 3, use the following command:
sudo nano /etc/inittab
And change the line to:
id:3:initdefault:
Then save and exit the file. The changes will take effect on the next reboot.
References:
SysV Init Runlevels - Red Hat Customer Portal
init - How can I see or change default run level? - Ask Ubuntu