How to change/set the default runlevel – Unix/Linux

The runlevel is specified in the /etc/inittab file. Different runlevels and details are listed below:

0 - halt (Do NOT set initdefault to this)
1 - Single user mode
2 - Multiuser, without NFS (The same as 3, if you do not have networking)
3 - Full multiuser mode
4 - unused
5 - X11
6 - reboot (Do NOT set initdefault to this)

The default runlevel means the runlevel of the Linux system which is appearing by-default after a reboot.
You can findout the current runlevel by executing the following command:

grep id:  /etc/inittab 

Example:

[[email protected] ~]# grep id:  /etc/inittab 
id:5:initdefault:

How to change the default runlevel?
you can change it simply by editing the line which has the runlevel id:

vi /etc/inittab
-----
id:5:initdefault:
-----

Then reboot to get the changes which you have made.

That’s it..!! đŸ™‚

Arunlal Ashok

Sr. Linux Server Administrator. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Check My Profile in uPwork (oDesk) and create a job, if you need any administration help. Thanks!!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *