SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Linux Startup
By: Amin Hashemi
AmirKabir University of technology
Computer Engineering & Information Technology Department
Contents
 System startup
 Services
 Controlling boot services
 References
System startup
System startup- BIOS
 BIOS stands for Basic Input/output System
 Performs some system integrity checks
 Searches, loads, and executes the boot loader program.
 It looks for boot loader in floppy, CD-ROM, or hard drive. You
  can press a key (typically F12 of F2, but it depends on your
  system) during the BIOS startup to change the boot
  sequence.
 Once the boot loader program is detected and loaded into
  the memory, BIOS gives the control to it.
 So, in simple terms BIOS loads and executes the MBR boot
  loader.
System startup- MBR
 MBR stands for Master Boot Record.
 It is located in the 1st sector of the bootable disk. Typically
  /dev/hda, or /dev/sda
 MBR is less than 512 bytes in size. This has three
  components:
   1) primary boot loader info in 1st 446 bytes
   2) partition table info in next 64 bytes
   3) MBR validation check in last 2 bytes.
 It contains information about GRUB (or LILO in old systems).
 So, in simple terms MBR loads and executes the GRUB boot
  loader.
System startup- GRUB
 GRUB stands for Grand Unified Bootloader.
 If you have multiple kernel images installed on your system,
  you can choose which one to be executed.
 GRUB displays a splash screen, waits for few seconds, if you
  don‟t enter anything, it loads the default kernel image as
  specified in the GRUB configuration file.
 GRUB has the knowledge of the filesystem (the older Linux
  loader LILO didn‟t understand filesystem).
System startup- Kernel
 Mounts the root file system as specified in the “root=” in
  grub.conf
 Kernel executes the /usr/src/linux/init/main.c program
 Since init was the 1st program to be executed by Linux
  Kernel, it has the process id (PID) of 1. Do a „ps -ef | grep init‟
  and check the pid.
 initrd stands for Initial RAM Disk.
 initrd is used by kernel as temporary root file system until
  kernel is booted and the real root file system is mounted. It
  also contains necessary drivers compiled inside, which helps
  it to access the hard drive partitions, and other hardware.
System startup- Kernel (cont.)
 Details about the specific sequence of events or
  what happens when the Linux kernel is loaded.
   Recognize, set up and initialize the CPU(s).
   Set up kernel memory and process handling.
   Initialize configured system devices.
   Start memory handling (paging, …).
   Set up and mount the file system.
   Start the init command.
System startup- init
 After the kernel has detected computer‟s hardware and load
  the correct device driver, init is started.
    The last step of kernel booting.
 It s the parent of all processes.
    PID = 1
 init role:
    The primary role of init is to create processes from a script stored
     in /etc/inittab.
    Running scripts in /etc/rc.d.
System startup- init- /etc/inittab
 This file describes how the init process should setup the
  system in a certain run level.
 /etc/inittab format:
     Id:run-level:action:process
     Id: a unique 1-4 character which identifies an entry in inittab.
     Run-level: run level number.
     Action: which action should be taken (wait, boot, initdefault, …)
     Process: the process to be executed.
System startup- init- /etc/rc.d
 rc
   Performs master control of which scripts to execute.
 rc.sysinit
   The system initialization script
 rc.local
   Used for local initialization
 /etc/rc.d/inid.d/
   A number of scripts used to start and stop services
 /etc/rc.d/rc*.d/ (* : 0–6)
   Each file is merely a soft link to a script under init.d
System startup- init- rc.sysinit
 This file is interpreted by init once at boot time.
 It contains bash shell script logic to perform some the
  following:
     Sets the system hostname
     Reads in network configuration data
     Prints welcome banner for login
     Configures the kernel
     Sets up the system time
     Sets the console and keyboard mapping
     …
System startup- Run levels
 A run-level is a software configuration of the system which
  allows only a selected group of processes to exist.
 When the Linux system is booting up, you might see various
  services getting started. For example, it might say “starting
  sendmail …. OK”. Those are the runlevel programs,
  executed from the run level directory as defined by your run
  level.
System startup- Run levels (cont.)
 Depending on your default init level setting, the system will execute the
  programs from one of the following directories:
 Run level 0 – halt (/etc/rc.d/rc0.d/) : Shuts down the system.
 Run level 1 – single user mode (/etc/rc.d/rc1.d/) :Mode for administrative
  tasks.
 Run level 2 – multiuser, without NFS (/etc/rc.d/rc2.d/) :Does not configure
  network interfaces and does not export networks services.
 Run level 3 – full multiuser mode (/etc/rc.d/rc3.d/) : Starts the system normally.
 Run level 4 – unused (/etc/rc.d/rc4.d/) :For special purposes.
 Run level 5 – Multi-User mode, with display manager as well as console
  logins(X11) (/etc/rc.d/rc5.d/) :As runlevel 3 + display manager.
 Run level 6 – reboot (/etc/rc.d/rc6.d/) :Reboots the system.
Services
 /etc/rc.d/init.d/
   A number of scripts used to start and stop services
Run Level and Services
 The scripts (in /etc/rc.d/rc*.d/) are actually symbolic links to
  system service scripts under the /etc/rc.d/init.d/ directory. So,
  /etc/rc0.d is linked to /etc/rc.d/rc0.d.
 Under the /etc/rc.d/rc*.d/ directories, you would see programs
  that start with S and K.
 Programs starts with S are used during startup. S for Startup.
 Programs starts with K are used during shutdown. K for kill.
 There are numbers right next to S and K in the program names.
  Those are the sequence number in which the programs should
  be started or killed.
 Example:
     K12mysql
     S12syslog
     S10network
     S80sendmail
Controlling Boot Services
 Manually rename Scripts
   Rename K to S and vice versa
   Change the number followed by K/S
 Manually start and stop services
   {start | stop | restart | status}
   /etc/rc.d/init.d/network start
   service network start
 Through graphical tool
   ntsysv
Controlling Boot Services
 Changing Run Levels
   The telinit command is used to change run-levels on-the-fly on a
    running Linux system.
    telinit 5
References
 http://www.thegeekstuff.com/2011/02/linux-boot-process/
 https://www.linux.com/news/enterprise/systems-
  management/8116-an-introduction-to-services-runlevels-and-
  rcd-scripts
 http://en.wikipedia.org/wiki/Linux_startup_process
 http://en.wikipedia.org/wiki/Runlevel
 Mr. Hamed Janzadeh‟s slides about linux startup
Thank you


 Website: Http://www.AminHashemi.com
 E-mail: Amin [at] aminhashemi [dot] com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Linux Booting Process
Linux Booting ProcessLinux Booting Process
Linux Booting Process
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Introduction to Linux basic
Introduction to Linux basicIntroduction to Linux basic
Introduction to Linux basic
 
Linux file system
Linux file systemLinux file system
Linux file system
 
A History of Linux
A History of LinuxA History of Linux
A History of Linux
 
U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
File System Hierarchy
File System HierarchyFile System Hierarchy
File System Hierarchy
 
Linux Boot Process
Linux Boot ProcessLinux Boot Process
Linux Boot Process
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Introduction to Ansible
Introduction to AnsibleIntroduction to Ansible
Introduction to Ansible
 
Linux
LinuxLinux
Linux
 
Linux Basics Knowlage sharing.pptx
Linux Basics Knowlage sharing.pptxLinux Basics Knowlage sharing.pptx
Linux Basics Knowlage sharing.pptx
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Linux: LVM
Linux: LVMLinux: LVM
Linux: LVM
 
Linux boot process
Linux boot processLinux boot process
Linux boot process
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
 

Andere mochten auch

Andere mochten auch (15)

IPTABLES
IPTABLESIPTABLES
IPTABLES
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
Linux network file system (nfs)
Linux   network file system (nfs)Linux   network file system (nfs)
Linux network file system (nfs)
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Linux booting process!!
Linux booting process!!Linux booting process!!
Linux booting process!!
 
linux file system
linux file systemlinux file system
linux file system
 
Linux file system
Linux file systemLinux file system
Linux file system
 
4. linux file systems
4. linux file systems4. linux file systems
4. linux file systems
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
File system.
File system.File system.
File system.
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)
 
File system
File systemFile system
File system
 
File Systems
File SystemsFile Systems
File Systems
 
Linux File System
Linux File SystemLinux File System
Linux File System
 

Ähnlich wie Linux startup

Ähnlich wie Linux startup (20)

6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Ch04 system administration
Ch04 system administration Ch04 system administration
Ch04 system administration
 
Ch04
Ch04Ch04
Ch04
 
System Init
System InitSystem Init
System Init
 
Bootloader and bootloading
Bootloader and bootloadingBootloader and bootloading
Bootloader and bootloading
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Your first dive into systemd!
Your first dive into systemd!Your first dive into systemd!
Your first dive into systemd!
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
Linux boot process – explained
Linux boot process – explainedLinux boot process – explained
Linux boot process – explained
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Linux basics
Linux basics Linux basics
Linux basics
 
OS_lab_file.pdf
OS_lab_file.pdfOS_lab_file.pdf
OS_lab_file.pdf
 
Linux basics
Linux basics Linux basics
Linux basics
 
Unix Shell and System Boot Process
Unix Shell and System Boot ProcessUnix Shell and System Boot Process
Unix Shell and System Boot Process
 
Order of boot process in Linux
Order of boot process in LinuxOrder of boot process in Linux
Order of boot process in Linux
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 

Kürzlich hochgeladen

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Linux startup

  • 1. Linux Startup By: Amin Hashemi AmirKabir University of technology Computer Engineering & Information Technology Department
  • 2. Contents  System startup  Services  Controlling boot services  References
  • 4. System startup- BIOS  BIOS stands for Basic Input/output System  Performs some system integrity checks  Searches, loads, and executes the boot loader program.  It looks for boot loader in floppy, CD-ROM, or hard drive. You can press a key (typically F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence.  Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.  So, in simple terms BIOS loads and executes the MBR boot loader.
  • 5. System startup- MBR  MBR stands for Master Boot Record.  It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda  MBR is less than 512 bytes in size. This has three components:  1) primary boot loader info in 1st 446 bytes  2) partition table info in next 64 bytes  3) MBR validation check in last 2 bytes.  It contains information about GRUB (or LILO in old systems).  So, in simple terms MBR loads and executes the GRUB boot loader.
  • 6. System startup- GRUB  GRUB stands for Grand Unified Bootloader.  If you have multiple kernel images installed on your system, you can choose which one to be executed.  GRUB displays a splash screen, waits for few seconds, if you don‟t enter anything, it loads the default kernel image as specified in the GRUB configuration file.  GRUB has the knowledge of the filesystem (the older Linux loader LILO didn‟t understand filesystem).
  • 7. System startup- Kernel  Mounts the root file system as specified in the “root=” in grub.conf  Kernel executes the /usr/src/linux/init/main.c program  Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1. Do a „ps -ef | grep init‟ and check the pid.  initrd stands for Initial RAM Disk.  initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.
  • 8. System startup- Kernel (cont.)  Details about the specific sequence of events or what happens when the Linux kernel is loaded.  Recognize, set up and initialize the CPU(s).  Set up kernel memory and process handling.  Initialize configured system devices.  Start memory handling (paging, …).  Set up and mount the file system.  Start the init command.
  • 9. System startup- init  After the kernel has detected computer‟s hardware and load the correct device driver, init is started.  The last step of kernel booting.  It s the parent of all processes.  PID = 1  init role:  The primary role of init is to create processes from a script stored in /etc/inittab.  Running scripts in /etc/rc.d.
  • 10. System startup- init- /etc/inittab  This file describes how the init process should setup the system in a certain run level.  /etc/inittab format:  Id:run-level:action:process  Id: a unique 1-4 character which identifies an entry in inittab.  Run-level: run level number.  Action: which action should be taken (wait, boot, initdefault, …)  Process: the process to be executed.
  • 11. System startup- init- /etc/rc.d  rc  Performs master control of which scripts to execute.  rc.sysinit  The system initialization script  rc.local  Used for local initialization  /etc/rc.d/inid.d/  A number of scripts used to start and stop services  /etc/rc.d/rc*.d/ (* : 0–6)  Each file is merely a soft link to a script under init.d
  • 12. System startup- init- rc.sysinit  This file is interpreted by init once at boot time.  It contains bash shell script logic to perform some the following:  Sets the system hostname  Reads in network configuration data  Prints welcome banner for login  Configures the kernel  Sets up the system time  Sets the console and keyboard mapping  …
  • 13. System startup- Run levels  A run-level is a software configuration of the system which allows only a selected group of processes to exist.  When the Linux system is booting up, you might see various services getting started. For example, it might say “starting sendmail …. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.
  • 14. System startup- Run levels (cont.)  Depending on your default init level setting, the system will execute the programs from one of the following directories:  Run level 0 – halt (/etc/rc.d/rc0.d/) : Shuts down the system.  Run level 1 – single user mode (/etc/rc.d/rc1.d/) :Mode for administrative tasks.  Run level 2 – multiuser, without NFS (/etc/rc.d/rc2.d/) :Does not configure network interfaces and does not export networks services.  Run level 3 – full multiuser mode (/etc/rc.d/rc3.d/) : Starts the system normally.  Run level 4 – unused (/etc/rc.d/rc4.d/) :For special purposes.  Run level 5 – Multi-User mode, with display manager as well as console logins(X11) (/etc/rc.d/rc5.d/) :As runlevel 3 + display manager.  Run level 6 – reboot (/etc/rc.d/rc6.d/) :Reboots the system.
  • 15. Services  /etc/rc.d/init.d/  A number of scripts used to start and stop services
  • 16. Run Level and Services  The scripts (in /etc/rc.d/rc*.d/) are actually symbolic links to system service scripts under the /etc/rc.d/init.d/ directory. So, /etc/rc0.d is linked to /etc/rc.d/rc0.d.  Under the /etc/rc.d/rc*.d/ directories, you would see programs that start with S and K.  Programs starts with S are used during startup. S for Startup.  Programs starts with K are used during shutdown. K for kill.  There are numbers right next to S and K in the program names. Those are the sequence number in which the programs should be started or killed.  Example:  K12mysql  S12syslog  S10network  S80sendmail
  • 17. Controlling Boot Services  Manually rename Scripts  Rename K to S and vice versa  Change the number followed by K/S  Manually start and stop services  {start | stop | restart | status}  /etc/rc.d/init.d/network start  service network start  Through graphical tool  ntsysv
  • 18. Controlling Boot Services  Changing Run Levels  The telinit command is used to change run-levels on-the-fly on a running Linux system.  telinit 5
  • 19. References  http://www.thegeekstuff.com/2011/02/linux-boot-process/  https://www.linux.com/news/enterprise/systems- management/8116-an-introduction-to-services-runlevels-and- rcd-scripts  http://en.wikipedia.org/wiki/Linux_startup_process  http://en.wikipedia.org/wiki/Runlevel  Mr. Hamed Janzadeh‟s slides about linux startup
  • 20.
  • 21. Thank you  Website: Http://www.AminHashemi.com  E-mail: Amin [at] aminhashemi [dot] com