Wikia

How To Wiki

Guide to linux boot sequence

1,794pages on
this wiki
Talk0




Boot SequenceEdit

  1. bootloader
  2. linux kernel
  3. inittab
    • /etc/inittab
  4. rc script (differs depending on which linux distribution
    1. init
      1. Background processes (network, system logging, cron, ...)
  5. login
    • For graphical: See Graphical
    • For text mode: See Text Mode

BootloaderEdit

Grub and lilo are the most popular bootloaders. They can load any OS any bootable drive or partition. They also pass kernel parameters to the Linux kernel.

Configuration Files:

  • /boot/grub/grub.conf

Configuration:

KernelEdit

The linux kernel boots up using the kernel parameters sent by the bootloader. The only other configuration to the kernel is done when compiling the kernel.

inittabEdit

After the kernel is loaded the first script to be run is inittab. This sets the runlevel, how to shutdown and use Ctrl-Alt-Del. It also sets the login program and executes the rc script.

Configuration File:

  • /etc/inittab

Configuration:

rc script (sysinit)Edit

The rc scripts differ from distribution to distribution, but they all do the same basic thing. They load the desired kernel modules and run the init scripts for the runlevel. The init scripts load the desired background processes, and are added or removed to each runlevel. The main rc script is generally not changed and init scripts and kernel modules are set by a program or setting file.

Main rc script:

Configuration:

init scriptsEdit

The init script run basic background processes, or programs. They are started by sysinit at boot up, however they can be started, stopped and restarted at any time.

Examples of init scripts: anacron, crond, famd, vsftpd, httpd, sendmail

Init scripts location:

  • /etc/rc.d/init.d/ or /etc/init.d/

Init scripts enabled/disable for each runtime (not recommended).

  • /etc/rc.d/rc[0-6].d/
Add/remove programs (recommended)

Text ModeEdit

For Graphical Login See Graphical Login Mode Below

After login the start up scripts depend on what's the default shell. Theses scripts are standard shell scripts.

BashEdit

Shell scripts automatically loaded for a login terminal. Listed in the order they are executed.

  • /etc/profile
    • Gentoo: /etc/profile.d/*.sh
  • /etc/bash/bashrc or /etc/bashrc
  • ~/.bash_profile
    if( ~/.bash_profile doesn't exists )
    ~/.bash_login
    if( ~/.bash_login doesn't exists )
    ~/.profile
  • ~/.bashrc


~/.bash_logout is executed when a login terminal is logging out

For a non-login terminal(i.e. xterm, aterm) Listed in the order they are executed.

  • /etc/bash/bashrc
  • ~/.bashrc


cshEdit

Shell scripts automatically loaded for a login terminal. Listed in the order they are executed.

  • /etc/csh.cshrc
  • /etc/csh.login
  • ~/.tcshrc
  • if ~/.tcshrc is not found
    • ~/.cshrc,
    • ~/.history
    • ~/.login
    • ~/.cshdirs

For a non-login terminal(i.e. xterm, aterm) Listed in the order they are executed.

  • /etc/csh.cshrc
  • ~/.tcshrc
  • ~/.cshrc

tcshEdit

Same as csh.

shEdit

login shells

  • /etc/profile
  • ~/.profile

logout: command or script specified using the *trap "command" 0

kshEdit

same as sh

zshEdit

Login shells

  • ~/.zshenv
  • ~/.zprofile
  • ~/.zlogin

Logout

  • ~/.zlogout

Interactive shell

  • ~/.zshenv
  • ~/.zshrc

rcEdit

Login shells

  • ~/.rcrc

sashEdit

Seems not to have any.

Graphical Login ModeEdit

...

Around Wikia's network

Random Wiki