System Init

1,530 views

Published on

Linux system initialization

Published in: Technology, Career
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,530
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
130
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

System Init

  1. 1. Understanding System Initialization
  2. 2. Hardware Initialization <ul><li>After PC-type computer started: </li></ul><ul><ul><li>CPU initializes itself </li></ul></ul><ul><ul><ul><li>Sends signals to control other parts of computer </li></ul></ul></ul><ul><ul><li>BIOS performs power-on self test (POST) </li></ul></ul><ul><ul><ul><li>Checks memory and other hardware </li></ul></ul></ul><ul><ul><li>BIOS sends signal to SCSI controller card telling it to initialize itself </li></ul></ul><ul><ul><ul><li>SCSI controllers usually contain own BIOS </li></ul></ul></ul>
  3. 3. Hardware Initialization (continued) <ul><li>After PC-type computer started (continued): </li></ul><ul><ul><li>Other hardware components instructed to initialize themselves </li></ul></ul><ul><ul><li>BIOS determines which devices to search for operating system </li></ul></ul><ul><ul><ul><li>BIOS loads boot loader into memory and passes control it </li></ul></ul></ul>
  4. 4. Hardware Initialization (continued)
  5. 5. The Boot Loader <ul><li>Boot loader or boot manager </li></ul><ul><ul><li>Small program loaded by BIOS </li></ul></ul><ul><li>Commonly used </li></ul><ul><ul><li>LILO (Linux loader) </li></ul></ul><ul><ul><li>GRUB (grand unified boot loader) </li></ul></ul><ul><ul><ul><li>Default on most systems </li></ul></ul></ul><ul><li>BIOS looks for executable program in first sector of 3.5-inch disk or CD-ROM </li></ul>
  6. 6. The Boot Loader (continued)
  7. 7. Starting the Kernel <ul><li>Initial piece of kernel </li></ul><ul><ul><li>Loads rest of kernel into memory </li></ul></ul><ul><ul><li>Uncompresses it </li></ul></ul><ul><li>dmesg command </li></ul><ul><ul><li>View messages stored by kernel during boot process </li></ul></ul>
  8. 8. Starting the Kernel (continued) <ul><li>Kernel ring buffer </li></ul><ul><ul><li>Area of memory </li></ul></ul><ul><ul><li>Stores messages from kernel </li></ul></ul>
  9. 9. Configuring Boot Loaders <ul><li>Configuration files </li></ul><ul><ul><li>Created by installation program </li></ul></ul><ul><ul><li>Examine how boot loader operates </li></ul></ul><ul><ul><li>Usually no need to change </li></ul></ul>
  10. 10. Using GRUB <ul><li>Installed by default for many versions of Linux </li></ul><ul><li>/boot/grub/grub.conf </li></ul><ul><ul><li>Configuration file for GRUB </li></ul></ul><ul><ul><li>Similar in layout and syntax to lilo.conf </li></ul></ul>
  11. 11. init and its Scripts <ul><li>init program </li></ul><ul><ul><li>Master control program </li></ul></ul><ul><ul><li>Starts many other programs </li></ul></ul><ul><ul><li>Runs scripts to initialize system services </li></ul></ul><ul><ul><li>Controlled by /etc/inittab configuration file </li></ul></ul><ul><li>Three main configuration files located in /etc/rc.d </li></ul><ul><ul><li>rc.sysinit </li></ul></ul><ul><ul><li>rc </li></ul></ul><ul><ul><li>rc.local </li></ul></ul>
  12. 12. Understanding Run Levels <ul><li>Run level </li></ul><ul><ul><li>Numbered mode of operation </li></ul></ul><ul><ul><li>Preconfigured set of services is activated </li></ul></ul><ul><ul><li>Defined in /etc/inittab file </li></ul></ul><ul><ul><li>Default run level 5 </li></ul></ul><ul><li>init or telinit command </li></ul><ul><ul><li>Change to different run level </li></ul></ul><ul><ul><li>Commonly done only to restart or halt system </li></ul></ul>
  13. 13. Understanding Run Levels (continued)
  14. 14. Understanding rc Scripts <ul><li>rc script </li></ul><ul><ul><li>Located in /etc/rc.d directory </li></ul></ul><ul><ul><li>Started with parameter that includes run level </li></ul></ul><ul><ul><li>Starts appropriate system services based on selected run level </li></ul></ul><ul><li>Each run level is associated with subdirectory </li></ul><ul><ul><li>Located in /etc/rc.d directory </li></ul></ul>
  15. 15. Understanding rc Scripts (continued) <ul><li>Each file begins with K or S followed by two-digit number </li></ul><ul><ul><li>Begin with K ―s topped (killed) </li></ul></ul><ul><ul><li>Begin with S ―s tarted </li></ul></ul><ul><li>Files symbolic links to scripts that stop and start services </li></ul>
  16. 16. Understanding rc Scripts (continued)
  17. 17. Controlling Services <ul><li>Many services listed in run-level directories relate to networking </li></ul><ul><li>Scripts allow user to change almost anything on Linux system without restarting computer </li></ul>
  18. 18. Configuring System Services <ul><li>Initialization scripts in /etc/rc.d/init.d </li></ul><ul><ul><li>Typically use configuration information located in /etc/sysconfig directory and subdirectories </li></ul></ul><ul><li>Files in /etc/sysconfig </li></ul><ul><ul><li>Named for services </li></ul></ul><ul><ul><li>Each file contains name-value pairs </li></ul></ul><ul><ul><ul><li>Define configuration options for service </li></ul></ul></ul>

×