These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX01/Inittab And Boot Scripts

Classnotes | UNIX01 | RecentChanges | Preferences

Even though we are examining networking, we need to first step back a bit and look at the boot process. The boot process and system networking go hand in hand as it is during this boot process the system is defined and that there are levels of booting in which the networking is delegated.

Runlevels and Linux

As Linux boots, reboots, or shuts down it passed through things called runlevels. The runlevels determine the abilities of the system. Under Linux there are generally 6 runlevels:
  • 0: This is the runlevel that is used to halt the system.
  • 1: This is for something called "single-user" mode.
  • 2: Multi-user with no networking.
  • 3: Multi-user with full networking.
  • 4: Unused.
  • 5: Multi-user, full networking, and GUI (X Window System)
  • 6: This is for rebooting the system.

Each of these runlevels has scripts associated with them. When entering a runlevel, the scripts for that runlevel are run in "start" mode. When exitting a runlevel, the scripts for the previous runlevel are run in "stop" mode. The entire boot process (including networking) is handled with scripts.

The file /etc/inittab tells your Linux system where the scripts are located and which runlevels to operate in.

The entries in the inittab file are in the following format:

 id:runlevels:action:process

where

  • id: Is some unique ID for the entry.
  • runlevels: Is the runlevel or runlevels this entry describe.
  • action: Describes the action to be taken.
  • process: This is the process to be executed.

The file is well documented, take a look at it now. Also, bear in mind that there is an inittab man page.

We will return to examine the inittab file more in the future, but for now we should note that it generally defaults to one of the networking runlevels, 3 or 5. Typically, if you wish to run your Linux server headless (with no monitor) then you will want to default to runlevel 3 to reduce system overhead. However, if the Linux box will function more as a Desktop or Workstation, then runlevel 5 will be what you want.

Though we'll look more at it later, you can use the telinit command to change between runlevels while the system is running.

Boot scripts

Now that you have seen the inittab file, you can see where the boot scripts for your system are installed. This is very important because there will be many scripts associated with networking on your system. On most Linuxes these scripts will reference external configuration files (which we will look at today), but you will find the occassional Linux flavor which will require you to modify these networking scripts to enable specific networking configurations in your system.

Under a system such as Red Hat or Debian you will not want to modify these scripts directly. However, you can always add your own additional ones as needed.



Classnotes | UNIX01 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited August 1, 2003 4:16 am (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.