Date post: | 10-Jan-2016 |
Category: |
Documents |
Upload: | anhduc120790 |
View: | 9 times |
Download: | 0 times |
of 14
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
1/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Module 03
Change Runlevels
and Shut Down or RebootSystem
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
2/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Objectives
Boot the System Boot-time Kernel Parameters
Introduction to Kernel Module Configuration
Change Runlevels and Shut Down or Reboot System Single-ser Mode
!verview of the "etc Directory #ree and the init Process
Setting the Default Runlevel
Determining $our System%s Runlevel
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
3/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Boot the System
It is the &ob of a boot loader' such as (I(! )(inu* (oader+
or ,RB ),Rand nified Bootloader+' to launch the (inu*
ernel at boot time
Boot-time Kernel Parameters Set in your boot loader%s configuration file )"etc"lilo.conf or
"boot"grub"menu.lst' and "boot"grub"grub.conf+
/owever' the (inu* ernel also has the ca0ability to acce0t
information at boot time from a ernel command-line interface
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
4/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Boot the System
Introduction to Kernel Module Configuration (inu* ernels are modular )modules of code traditionally com0iled into the
ernel )a sound driver+ are loaded as needed
Can be inserted and removed by the su0eruser if necessary )using insmod
and rmmodcommand+
Kernel boot-time messages
1 2s the (inu* ernel boots' it gives detailed status of its 0rogress in theform of console messages3
4 Kernel identification
4 Memory and CP information
4 Information on detected hardware3 mice' diss5
4 6etwor initiali7ation4 Kernel module out0ut for modules that load at boot time
1 #o view messages from the last boot se8uence3 # dmesg | more
Reviewing system logs3
1 found in the system logfiles such as "var"log"messages
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
5/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
Runlevel S0ecifies different ways to use a system by controlling which
services are running
Runlevels are s0ecified by the integers 9 through :
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
6/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
Runlevel 3
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
7/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
Single-ser Mode 3 Runlevel ;' the single-user runlevel' is a bare-bones o0erating
environment intended for system maintenance
Remote logins are disabled' networing is disabled' and most
daemons are not started
!ne common reason you might be forced to use single-user mode
is to correct 0roblems with a corru0t filesystem that the system
cannot handle automatically
#o switch into single-user mode from another runlevel3
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
8/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
!verview of the "etc Directory #ree and the init Process3
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
9/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
!verview of the "etc Directory #ree and the init Process3 "etc"rc3
1 #his file is a scri0t that is used to change between runlevels
"etc"init.d3
1 #his directory contains individual startu0"shutdown scri0ts for
each service on the system1 Exp3 the scri0t/etc/initd/httpd 0erforms some checs before
starting or sto00ing the 20ache web server
1 =alid arguments 3 start! stop! restart! status! reload
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
10/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
!verview of the "etc Directory #ree and the init Process3 #he directories "etc"rc9.d through "etc"rc:.d3
1 #he initiali7ation scri0ts in "etc"init.d are not directly e*ecuted
by the init 0rocess. Instead' each of the directories "etc"rc9.d
through "etc"rc:.d contains symbolic )soft+ lins to the scri0ts in
the "etc"init.d directory.
1
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
11/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
Setting the Default Runlevel3 #o determine the default runlevel at boot time' init reads the
configuration file/etc/inittab
6 is a valid runlevel number' such as >
6ever change the default runlevel to 9 or :
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
12/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
Determining $our System%s Runlevel3 se the runlevelcommand
It dis0lays the previous and current runlevel as integers'
se0arated by a s0ace
If no runlevel change has occurred since the system was booted'
the previous runlevel is dis0layed as the letter "
Exp$ a system that was in runlevel > and is now in runlevel ?' the
out0ut is3
2 system with a default runlevel of ? that has &ust com0leted
booting' the out0ut would be3
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
13/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
Changing runlevels with init and telinit3 #he init or telinit command sends signals to the e*ecuting init
0rocess' instructing it to change to a s0ecified runlevel
#he telinitcommand may be used in 0lace of init.telinit is simplya
lin%to init' and the two may be used interchangeably
7/18/2019 Module 03 - Change Runlevels and Shut Down or Reboot System
14/14
LPIL
inux
Certificat
ion
http://ww
w.bk
acad
.com
Change Runlevels and Shut Down or Reboot System
System shutdown with shutdown3