Command Line Tools

how switch between runlevel

Each runlevel designates a different system configuration and allows access to a different combination of processes. Runlevels determine how much of the systems services are actually running. If you switch to higher run levels, mean you are making additional services on or if you are moving lower level means you are switching off currently running services Most common runlevel for servers is going to be 3, most services that are not GUI oriented (including the Gnome Desktop) are turned off.

In practical environment generally linux system administrator use run level 3 .

In exam we suggest you to keep runlevel 5 as higher runlevel means more available services. Runlevel 5 is what you see when you boot into the desktop environment.

Red Hat Linux/Fedora runlevels
CodeInformation
0Halt
1Single-User mode
2Multi-user mode console logins only (without networking)
3Multi-User mode, console logins only
4Not used/User-definable
5Multi-User mode, with display manager as well as console logins (X11)
6Reboot

To check current run level use runlevel command.

runlevel graphic 5

Switching between these levels is fairly straightforward. To switch to runlevel 3 type: init 3

init 3 from graphc

to check current runlevel and last runlevel use who command with -r switch

who with r swtich

as output show our current runlevel is 3 and last runlevel was 5

you could also use runlevel command to check the current level and last runlevel

runlevel command

runlevel command first show previous runlevel and later current runlevel as output show our previous runlevel was 5 and current is 3

Default runlevel is set in /etc/inittab file, during the exam you may need to change default runlevel. In real life checking default runlevel is a good point to start troubleshooting of a system which is getting reboot just after the boot or system is not getting desktop environment

open /etc/inittab

vi inittab

locate following line,

id:5:initdefaults:

5 is default runlevel here you could change it, but don't set to 0 or 6 as it is also suggested in file.

default inittab

to switch back to graphic run init 5

runlevel 5

in graphic you could use runlevel to check our last runlevel

graphic switch back 5

Search more about

Search in Google for

Custom Search