Linux Blog

Run Levels in a Nutshell

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 9:03 am on Wednesday, March 11, 2009

Run levels in Linux are a great thing. Basically, a run level is by definition a configuration for a group of processes. The run levels and default run level is specified in /etc/inittab. Most Linux systems these days, with exception of a few boot into run level 5 which is generally a graphical user interface such as KDM or GDM. The others boot into run level 3 most servers will boot into this run level which is multi-user with networking but no X, and is many users preference.

To define what run level your system boots into by default you would edit the /etc/inittab file and edit the line similar to:

 id:5:initdefault:

This is run level 5, if you wanted to switch to command line you’d change the 5 to 3 and vice versa.

If your not ready to make the jump yet but would like to check it out, you can (as root) use the command telinit to tell init to change run level. If you are in run level 5, try (be prepared to lose everything in X, as it will kill everything for you)

 telinit 3

If you are doing maintenance, you may want to switch to level 1 which is single user mode. Level 2 on Fedora is the same as 3 except it doesn’t have NFS support.

Level 0 is halt and run level 6 is reboot which are the best ones to accidentally set as a default run level (trust me on this one.) For more information on the different run levels check out the man pages.

Man Pages for commands in this post »

inittab

3 Comments »

Comment by G&T

March 12, 2009 @ 12:09 am

Or install sysv-rc-conf to change the runlevels.

Comment by TheLinuxBlog.com

March 12, 2009 @ 10:31 am

@G&T Good call, I’ve never used a package to change the default run level, and it never occurred to me to try and find, or use one.
The package does not seem to be available in Fedora 9 at least from my yum searches and browsing through the set up options.

Pingback by The Linux Blog » Fedora 11 Upgrade from Alpha to Beta

April 1, 2009 @ 11:48 am

[...] to aid I set up sudo, and changed my default run level to 3. I installed bash-completion (a mandatory package) and then changed to run level 3 with [...]

RSS feed for comments on this post. TrackBack URI

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>