Setting the Default Runlevel

To determine the default runlevel at boot time, init reads the configuration file /etc/inittab looking for a line containing the word initdefault, which will look like this:


In the preceding, N is a valid runlevel number, such as 3. This number is used as the default runlevel by init. The S scripts in the corresponding /etc/rcN.d directory are executed to start their respective services. If you change the default runlevel for your system, it will most likely be in order to switch between the standard text login runlevel and the GUI login runlevel. In any case, never change the default runlevel to 0 or 6, or your system will not boot to a usable state.

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.