NetworkClue.com
NetworkClue Home PageHome Contact UsContact ConsultingConsult
Bulletin Board
Internet Services covers Secrets to hosting websites, Hosting your own web server, and using DNS Servers.Operating Systems leads you through the decision of Linux vs. Windows, ideal installations and setups to create an efficient and redundant environment for your business, and great features to make management easier.Routing & Firewalls contains articles that will allow you to take control of your router. Learn how to protect your company with access lists and advanced firewall techniques.Hardware answers the common questions about Switches vs. Hubs, recommends SysAdmin Tools, and recommendations for adequate power protection.Utilities will cover fighting spam, using Anti-Virus programs effectively and the must haves for every administrator's software toolbox.


Bulletin Board

Linux Run-Levels

By Joshua Erdman
Digital Foundation, inc.

Linux has 7 different run levels (or operating modes):

  • rc0.d - System Halted
  • rc1.d - Single User Mode
  • rc2.d - Single User Mode with Networking
  • rc3.d - Multi-User Mode - boot up in text mode
  • rc4.d - Not yet Defined
  • rc5.d - Multi-User Mode - boot up in X Windows
  • rc6.d - Shutdown & Reboot

Each mode has it's own list of settings for what services to start and what services to shutdown. Not only does this list contain what is supposed to be running, but also what order each service should be started in - a feature many Linux lovers like to point out that Windows lacks..

chkconfig - will list all the registered services and display thier status at each different run level.

Most of the time when your server boots up it will start in runlevel 3 or 5 depending on what it is set to. This setting can be found in the file /etc/inittab

If you ever want to change what mode your server defaults to on bootup, just edit that file, but NEVER change it to runlevel 6 or 0. This will cause your server to shutdown on bootup or if you set it to runlevel 6 it will continuously reboot. I guess this could make a great prank on a friend's workstation.

RC.D Directory Explanation

In the folder: /etc/rc.d are all the run level folders starting from rc1.d to rc6.d and including init.d

It is in each of these rc#.d folders where the service run settings are kept. If you change directory into /etc/rc.d/rc3.d all the files that start with a capital S are the services that will start at this runlevel. All the files that start with a K are the services that will be killed at that runlevel.

The reason why services that are not supposed to run are still listed is because it is popular to switch a server from one run level to another instead of just booting into the needed run level. That way you can take your server offline (single user mode) and then apply a patch or do a file restore.

Let's take a closer look at these files that are inside the rc#.d folders. Notice that they are symbolic links to the script file located in /etc/rc.d/init.d This makes things very easy. All the commands to start, stop, or reload a service are handled by these scripts. So when a server is to go into a specific run level it can find the correct script and knows whether to start it based on its name and link path.

Switching Run Levels

   init <Run Level number>

See Linux Commands for other and command line utilities.

Recommended Articles:
RedHat Package Manager

Article last reviewed: 12/13/2006

Created by: Digital Foundation, inc.

Copyright © 2002-2005 Digital Foundation, inc. www.networkclue.com

All content of the NetworkClue website is copyrighted. Articles, notes, outlines, and all other materials may not be stored on the Internet or sold or placed by themselves or with other material in any electronic or printed format in whole or part. However materials may be referenced by links to the site.

 

Related Articles:
Linux
Windows vs. Linux

Books:

Red Hat Linux Bible
RedHat Linux 8.0
Bible

Search Amazon for
Books on Linux