Upload
sherril-vincent
View
214
Download
0
Embed Size (px)
Citation preview
8/6/2019 (Chap. 13)the System Boot Process
1/11
The System Boot Process
(Chap. 13)
ICE System Consultant 2nd
2002 8 7
8/6/2019 (Chap. 13)the System Boot Process
2/11
2011-07-01 By Sang-Il Yoon 2
Objectives
Describe the four phases of the boot processModify the kernels configuration file
Describe the eight run levels
Explain the purpose of the /etc/inittab file
Describe the steps in the init process to bring a system to
multi-user mode
List the directories that hold the run control scripts used to
stop and start system processes and servicesDescribe the steps to add a new run control script
8/6/2019 (Chap. 13)the System Boot Process
3/11
2011-07-01 By Sang-Il Yoon 3
Run Levels
%who r command Shows current run level
8/6/2019 (Chap. 13)the System Boot Process
4/11
2011-07-01 By Sang-Il Yoon 4
The Boot Process
Power onPOST (in PROM)
PROM parameter (boot-device)
Read the 1 ~ 15 sector (boot block)
Ufsboot (secondary booting program) loading to memory
Kernel load
Kernel module load
Initialize the kernel (read the /etc/system file)
/etc/init process
Read the /etc/inittab file
8/6/2019 (Chap. 13)the System Boot Process
5/11
2011-07-01 By Sang-Il Yoon 5
The Boot Process (Cont.)
Boot PROM phasePOST to boot block
Boot programs phase
Ufsboot to load kernel
Kernel initialize phase
Kernel module load to reading /etc/system file
Init phase
Kernel starts /etc/init to rc script
8/6/2019 (Chap. 13)the System Boot Process
6/11
2011-07-01 By Sang-Il Yoon 6
/etc/system File
ModdirSets the search path for default loadable kernel modules
Root device and root filesystem configurationSets the root file system type to the listed value
Default value is ufsSets the root device (physical name)
ForceloadForces the kernel modules to be loaded during kernel
initializationSetChanges kernel parameters to modify the operation of the
system
8/6/2019 (Chap. 13)the System Boot Process
7/11
2011-07-01 By Sang-Il Yoon 7
/etc/inittab File
To change run levelWhen the system boots, the init daemon starts processes
by reading information from the /etc/inittab file
Include
Systems default run levelwhat process to start, monitor, or restart if terminated
What actions to take for new run level
Form
Id : identifier for the entryRstate : run level for this entry
Action : how the process is to be treated
Process : execute
8/6/2019 (Chap. 13)the System Boot Process
8/11
2011-07-01 By Sang-Il Yoon 8
Run Control Script
/sbin directoryEach run level has an associated rc script located in the /sbin
directory
Rc0, rc1, rc2, rc3, rc5, rc6, rcS
Executed by init to set up variables
/etc/rc#.d directoryScript that start and stop system processes for that run level
Start with S- file : start the script with current run level
Start with K- file : kill the process with current run level
/etc/init.dRun control scripts
Hard-linked to /etc/rc#.d directory
8/6/2019 (Chap. 13)the System Boot Process
9/11
2011-07-01 By Sang-Il Yoon 9
Creating a New Run Control Script
rc_test file#!/bin/sh
#test rc script
case $1 in
start) /usr/bin/audioplay /usr/demo/SOUND/sounds/ring.au
/bin/banner rc_start
;;
stop) /usr/bin/audioplay /usr/demo/SOUND/sounds/bark.au
/bin/banner rc_stop
;;
esac
8/6/2019 (Chap. 13)the System Boot Process
10/11
2011-07-01 By Sang-Il Yoon 10
Creating a New Run Control Script (Cont.)
#vi /etc/init.d/rc_test#chmod +x rc_test
#/etc/init.d/rc_test stop
#/etc/init.d/rc_test start
#ln rc_test /etc/rc3.d/S100rc_test
#ln rc_test /etc/rc0.d/K100rc_test
8/6/2019 (Chap. 13)the System Boot Process
11/11
2011-07-01 By Sang-Il Yoon 11
System Shutdown Procedures
#halt = init 0 : ok go command#reboot = init 6
#poweroff = init 5 : power off
#shutdown = init sNo power off
Kill all the processes & change the run level
Options
-y : shutdown right now -g 300 : shutdown after 300 second
-i 0 ~ s : change the run level