Debian Start Scripts and Order of Operations

From Notes

Jump to: navigation, search

Debian defaults to runlevel 2.

The first script that init executes is /etc/init.d/rcS. This script runs all of the scripts in /etc/rcS.d. Next, it runs all scripts in /etc/rc.boot. The latter is primarily for system administrative scripts.

Re-cap

  1. init runs
  2. init runs the script /etc/init.d/rcS
  3. /etc/init.d/rcS runs all scripts in /etc/rcS.d
  4. /etc/init.d/rcS then runs all scripts in /etc/rc.boot

Runlevel Overview

  • 0 (halt the system),
  • 1 (single-user mode),
  • 2 through 5 (various multi-user modes), and
  • 6 (reboot the system).

After the boot scripts are run, Debian then runs all scripts in the appropriate runlevel directory, /etc/rcX.d

  • All scripts that are shutdown or not running for a specific runlevel are in that rcX.d directory and begin with a 'K'
  • All scripts that are started up or running for a specific runlevel are in that rcX.d directory and begin with an 'S'

Configuring a Script to Start or Shutdown with the System

  • update-rc.d is used to accomplish this task.
Personal tools