Breaking News

IPU BCA Semester 6 - Linux Environment - Understanding Run Levels

Understanding Run Levels

Linux Environment
IPU BCA Semester 6 - Linux Environment - Understanding Run Levels
bum tool (Boot Up Manager in Ubuntu showing
what services run under different run levels)

Question: What are different run levels in Linux OS?

Answer: Linux is a multi user and multi tasking operating system. Multiple users can login and work simultaneously on a single server. However there are requirements when a single user alone should work (generally for administration purposes). Linux run levels are the modes that allow you to define whether Linux OS environment is available for all users  or just a single admin user, or it will provide network services or graphic desktop support.

During kernel boot, the process 'init' supports multiple run levels as parameters i.e. 0 to 6.

Run Level Parameter Mode Meaning
0 Halt Shuts down system
1 Single-User Mode Does not configure network interfaces, start daemons, or allow non-root logins
2 Multi-User Mode Does not configure network interfaces or start daemons.
3 Full Multiuser with Networking Starts the system normally.
4 Not Used Not used/User-definable
5 X11 Windows Full Multiuser with Networking and X Windows(GUI)
6 Reboot Reboots the system

Most console/shell based Linux servers Most start in runlevel 3. Linux servers with a GUI and desktop support start runlevel 5.

Run levels can be invoked from the command line using either init e.g.
$ unit 6           (reboot the system)

A computer’s default run level is stored in a text file called inittab that is present in the /etc directory. In latest kernels (e.g. Google Chrome OS), init is irrelevant and run levels are controlled by another daemon called Upstart process manager. Under Upstart, various run levels is defined by the files kept under /etc with names like rc0.d, rc1.d, and rc2.d The default run level in Upstart process is defined in the /etc/init/rc- sysinit.conf file.