LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-12-2008, 03:17 PM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,378

Rep: Reputation: Disabled
What does a runlevel do?


I just read in Linux for Dummies that the runlevel used for booting into the GUI is 5 and that used for booting to a command line is 3. But then I looked at my inittab file and saw some remarks indicating that the runlevel number controls halting and rebooting and whether the session (wrong word?) is multiuser or single-user. Is the book wrong?
 
Old 08-12-2008, 03:22 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Runlevels were SYSVs Unix's way of providing different services in a somewhat layered fashion. Consider run level 1 being single user, level 2 being run level 1 + some networking, run level 3 being full multi-user, and often run level 6 being reboot. Run levels 4, and 5 were rarely used.

Today, run level 5 is generally the same as 3, except the TTY login is replaced by a GUI login (eg. GDM). Run level 4 still isn't used much. Run level 0 was halt. Some distros use a single run level (3 or 5 only) for multiuser.
 
Old 08-12-2008, 03:37 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,343

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
When the kernel finishes booting it runs the init program and passes the run level as a parameter to init. All of the possible things that init can do are described in a file called /etc/inittab. init looks up the run level it has been passed in /etc/inittab and runs the scripts that correspond to that run level.

The scripts can be anything. Each distribution creates whatever init scripts it feels like and describes them as run levels in /etc/inittab. What the book describes as run levels 3 and 5 is how they are defined in Red Hat, Fedora, and CentOS. Almost all distributions also have run levels for halting and rebooting and whether the session is multiuser or single-user. Debian also has a runlevel for power failures.

The book is not wrong. It is just describing 2 of the several run levels found in Red Hat.

-------------------------
Steve Stites

Last edited by jailbait; 08-12-2008 at 03:38 PM.
 
Old 08-12-2008, 03:43 PM   #4
newbiesforever
Senior Member
 
Registered: Apr 2006
Location: Iowa
Distribution: Debian distro family
Posts: 2,378

Original Poster
Rep: Reputation: Disabled
Thank you, Jailbait. That answered my question.
 
Old 08-12-2008, 03:56 PM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by Mr. C. View Post
Run level 4 still isn't used much.
Slackware still uses runlevel 4 as the default to start X instead of 5. 5 is treated like runlevel 3 (multiuser).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's the difference between runlevel 2 and runlevel 5 in Debian? davidas Linux - Newbie 2 01-05-2012 01:10 PM
New Install of PCLinuxOS boots into runlevel 3. Should be runlevel 5 MonctonJohn Linux - General 4 02-01-2008 04:38 PM
Go into runlevel 3 after a runlevel 4 crash davidguygc Linux - General 1 08-24-2007 08:23 PM
Soun Mixer absent in Runlevel 3 but present in Runlevel 5 debloxie SUSE / openSUSE 1 01-18-2006 09:15 AM
X does not start in Runlevel 4, but i Runlevel 3 Rabon Linux - General 3 11-18-2003 06:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration