linux runlevel

Do you know what is runlevel in Linux ? This is one of the important term use in linux. There are 7 Runlevel mode in Linux. In this post we will try to explain about runlevel in Linux Operating System.

What is runlevel

In linux the Runlevel is described as the state or mode that is defined by the services.These services are defined in directory /etc/rc.d/ . Given below is the output

[root@localhost ~]# cd /etc/rc.d/
[root@localhost rc.d]# ls
init.d rc0.d rc2.d rc4.d rc6.d rc.sysinit
rc rc1.d rc3.d rc5.d rc.local
[root@localhost rc.d]#

Here inside the directory /etc/rc.d/, there are some directories like rc0.d,rc2.d………rc6.d which represent the corresponding Runlevel.

These are the following Runlevel which are used in Linux
• 0 — Halt
• 1 — Single-user mode
• 2 — Not used (user-definable)
• 3 — Full multi-user mode
• 4 — Not used (user-definable)
• 5 — Full multi-user mode (with an X-based login screen)
• 6 — Reboot

For text mode Runlevel 3 is used and for GUI (Graphical User Interface) Runlevel 5 is used.

We can change the runlevel of Linux Operating System by updating runlevel value in /etc/inittab file.In /etc/inittab file there is a line…
id:5:initdefault:
Here 5 represent the Runlevel 5.If we write 3 instead of 5 in this line then machine will run in runlevel 3 in next system reboot.The /etc/inittab file is meant for by-default runlevel setting of the Linux Operating System.

For Shutting down the Machine we can use the command init 0.
And for system restart we can use the command init 6.

Examples:

For Shutting Down Linux System:

[root@localhost ~]# init 0

For Linux System Restart:

[root@localhost ~]# init 6

Read Some More Articles

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.