This article describes how to change Linux run levels. Changing Linux run levels is useful in troubleshooting problems where it is suspected that there is a daemon or application being loaded into Linux that may be causing unexpected operating system behavior. Examples of such unexpected behavior include crashes, the operating system failing to respond or being slow, and network problems. If the unexpected behavior stops after disabling a service or application then the source of the problem is identified. Other reasons for changing the run level include not having a requirement for an X-Windows environment and needing to perform system maintenance.
Resolution
To change the run level of a Linux operating system:
Note: If the run level is being changed to troubleshoot a problem with the operating system or an application, following this procedure may remove a software environment that is required to test the health of your operating system.
Ensure that you are logged in as a user with root privileges.
Edit the file /etc/inittab in the text editor of your choice.
Note: To perform this from a shell prompt using the VI text editor, refer to the Additional Information section at the end of this document.
Look for the line of text id:X:initdefault: where X is replaced by a number. This number represents the default Linux run level.
Edit the line of text and replace X with the run level you want to change to:
1
Single User Mode
3
Full multiuser
5
X-Windows (X11)
Note: The above is a list of run levels that are generally used. If the full list is not displayed at the top of the inittab file and you need to change to a level not listed, refer to the manual for your distribution of Linux.
Warning: Do not set X to 0 or 6.
Save the edited file.
Reboot the operating system.
Note: Linux boots into the new run level each time it is started. To return it to its former behavior, repeat steps 1-6 and edit the file to use the original value of X.
Note: It is possible to change the run level without rebooting the operating system and without affecting the run level the operating system defaults to when it is started: