Run Levels

Run Levels...


Run levels are what the os runs in. There are seven... 0 thru 6.

  • 0 - shut down or halt the system
  • 1 - single user mode
  • 2 thru 5 - multi user mode
  • 3 - on some systems, level 3 has networking support while 2 does not
  • 4 - on some systems supports networking and Xwindows
  • 5 - on some systems supports networking and Xwindows
  • 6 - reboot the system

When run levels change the scripts in the /etc/init.d directory are executed but not directly. They are executed through SymLinks placed in coresponding run level directories. These directories are labeled rc0.d through rc6.d, one for each run level. So at run level 3 the SymLinks in /etc/rc3.d are executed which in turn fires the corresponding scripts in the /etc/init.d directory.

CREATED 2012-11-27 04:05:07.0

00-18-5D

UPDATED 2012-11-27 04:37:45.0

Naming The Links...


The SymLinks are named with a letter, two digits and a name. e.g. K30MyScript and S30MyScript. The K stands for Kill and executes the coresponding link with a stop argument. The S stands for Start and executes the corresponding script with a start attribute. The number following the letter is to place the links in a specific order so that dependencies can be cleaned up. The name is the name of the script. Since all SymLinks are fired in alphebetical order, all the scripts begining with K will be fired first. Then all the scripts begining with S will fire.

Example: an ftp server pro ftp has a script in the /etc/init.d directory called proftpd. The name of the script is proftp, the d at the end is shorthand for demon because it runs as a background process. At run level 2, the /etc/rc2.d directory and all its SymLinks will fire. For the proftpd script there is only one SymLink: S03proftpd. This is a start script (because of the s) and it will fire in the order S03proftpd comes, in the list of SymLinks to be executed. If another process had to stop before this process could start there would be a SymLink begining with a K in this folder. In the /etc/rc6.d directory there is a script labeled K01proftpd, which is the Kill SymLink for proftpd script in the /etc/init.d directory. At run level 6 this script will execute and shut down the ftp server berfore the machine reboots.

CREATED 2012-11-27 04:40:12.0

00-18-5F

UPDATED 2012-11-27 04:40:19.0

Knowledge

L
I
N
K
S

DBID: db.wam

Page Server: Ruger

©2012 Leistware Data Systems

      Hello anonymous