Вы находитесь на странице: 1из 11

Chapter 4

Booting and Shutdown


CSNB113 SYSTEM ADMINISTRATION
College of Information Technology
Universiti Tenaga Nasional (UNITEN)

1
SN 2017
Objectives

 Understand the concept of run levels and their role in startup


and shutdown operations

SN 2014 2
Introduction

 Startup and shutdown procedures are controlled by automated


shell scripts
 System administrator needs to know that exact sequence of
steps the system follows during the two events – able to fix if
things do go wrong

3
SN 2017
Booting

•Machine is powered Step 2 •Follow a series of Step 4


on steps  lead to the
•System looks for all loading of kernel •Kernel spawns init
peripherals into memory (PID1), followed by
other processes

Step 1 Step 3

PID1: Process-id 1

4
SN 2017
init

 init process: second process of the system


 Behavioral pattern of init for three vital reasons:
 Maintains the system at a specific run level (state) and decides
which processes to run for each run level
 Parent of all system daemons (process) that keep running all the
time
 Spawns a getty process at every terminal so that users can log in –
parent of all shell

5
SN 2017
Run level

 Indicated by a single digit (0 to 6), or an s or S

Run level Description


0 System shutdown
1 System administration mode (local file system
mounted)
2 Multiuser mode (NFS not available)
3 Full multiuser mode
5 The graphical environment mode in Linux
6 Shutdown and reboot mode
s or S Single-user mode (file systems mounted)
6
SN 2017
init : Run level

init state 1 or S
•Machine is powered
on

init state 0 or 6 init state 2, 3, or 5


•System is shutdown •Multiuser mode

System administrator has the freedom to use the init command to


move the system to any run level. Example: # init 1
7
SN 2017
Display run level

who -r
surizal@sn010101-scnb113 :~$ who –r
run level 2 2014-05-04 10:03

Example:
Run level 2: ___________ mode

8
SN 2017
Shutdown

 shutdown command: shut the machine down


 Notifies users with wall about the system going down with a
directive log out
 Activities during shutting down (sleeping for one minute):
 Sends signals to all running process – normally terminate the
process
 Log off and kill remaining processes
 Unmounts all secondary file systems – unmount command
 Write all memory-resident data to disk – sync command
 Notifies users to reboot or switch off
9
SN 2017
Shutdown - Ubuntu

 P option: overrides the default sleeping time of one


minute
# rshutdown –P 2
option: shutdown and restart/reboot
Powers down machine after 2 minutes
# shutdown –P 0 Immediate shutdown
# shutdown –r 0 Immediate shut down and reboot

10
SN 2017
References

1. Das, S. (2012). Your UNIX/LINUX The Ultimate Guide:


Third Edition. McGraw-Hill
2. Hahn, H. (2008). Harley Hahn's Guide to Unix and
Linux. California: McGraw-Hill Higher Education

SN 2014 11

Вам также может понравиться