Runlevels are meant for specifying different configuration of running services. With the help of runlevel we can control the installed services.
Runlevels are also available in windows system but it is very complex to set in windows.
There are 6 run levels also called init level.
- Runlevel 0 is for shutdown phase
- Runlevel 1 is for maintenance mode. This is single User mode, and very basic command can run in this level
- Runlevel 2 starts most of the services except the networking part. Allows multiple user to login.
- Runlevel 3 is used for server purpose. Starts all the services except X window system
- Runlevel 4 is same as level 3 but more services can be added. Generally not in use.
- Runlevel 5 is what we generally enter into Linux system. Allows everything with graphics.
- Runlevel 6 is for reboot.
Like Runlevel 1 in linux is same as safe mode in windows. The init file configuration is stored in the /etc/inittab file. Open this file in Vi editor and you will see the init level. Here you can change the default value of runlevel. When you will open this file, you will see this line
Here 3 denotes the runlevel. You can change the number and then restart the system. Never set the number to 0 ot 6 because these number are for shutdown and reboot process.
I am not using Linux now so I cant show you my configuration file but in few days i will install linux and then paste the output of inittab.
You can check the runlevel of your system with the command “who –r”
You can also change the runlevel with the help of the command.
Try init6, it will just restart your system.
Remember that these run levels change with different flavours of Unix ...
The runlevels change slightly in flavours of Linux , but if you look at the bigger picture i.e flavours of unix , it varies even much more...
For Eg : in Solaris ..
0 - Open Boot prompt (OBP) also called OK prompt. The system is taken down to PROM monitor or Security monitor state. It is safe to power off the hardware.
1,s,S - Single-User or Administrative mode where user logins are disabled. Also minimal Kernel functions and minimal required file systems are mounted (/ and /usr).
2 - Multi-User mode without Networking (No NFS)
3 - Multi-User mode with Networking (Default)
4 - Not in use
5 - Shut-down and power OFF. Power OFF supported on Sun 4m & Sun 4u architecture. More like a boot -a where the system is taken down to run level 0 and then an interactive boot.
6 - Reboot. takes the system down to run level 0 and then back to the default run level (3) ,
So , if you go to runlevel 5 in Solaris , instead of a beautiful Linux desktop , you would see a Solaris boot screen ..