Lecture #4 System Startup and Shutdown
Learner Outcomes
Describe the steps involved in booting a computer and in shutting one down.
Configure the
init
daemon to control into which runlevels the system will boot.
Configure a runlevel for a networked X Workstation.
Troubleshoot a system that won't root because of a failed system service
Activities
Configure which runlevel a system will boot into
Boot a Linux system into System Maintenance mode
Disable ctr-alt-del reboot, and password protect single user mode.
Shutdown a system in a safe and secure manner
Assignment
Read Chapter 2
System Startup and Shutdown
Booting the System
Power On Self Test (POST) - loads the BIOS
BIOS loads the Master Boot Record
MBR reads its partition table to determine which partition to boot into
MBR loads the boot program in the active partition
Boot program presents user with a boot prompt
Based upon user selection, boot program loads the desired kernel along with any supplied boot options
Kernel uncompresses and loads into memory
Kernel detects hardware and initializes its data
Rooting the System
Kernel mounts the root file system
Kernel creates and starts the
init
process
Init reads
/etc/inittab
for its instructions
Init performs system initialization:
presents some kind of welcome banner
allows for an interactive startup
sets up keyboard mapping, system fonts, plug and play devices, ...
checks for dirty file systems, and cleans them if necessary
checks disk quotas and swap space
mounts all file systems
Chooses which runlevel to come up in and executes those scripts via rc script
daemons load
getty processes are spawned on terminal devices
LILO, GRUB and Dual Booting
LILO boot manager
The
/etc/lilo.conf
file
The
lilo
command
GRUB boot manager
The
/boot/grub/grub.conf
file
stage1
and
stage2
boot loaders
Init and Runlevels
The
/etc/inittab
file
A two letter system identifier
id
A list of runlevels for specified actions
An action - How and when should a command be run
process - which command to run
Runlevels
Runlevel 0
Runlevel 1
Runlevel 2
Runlevel 3,4,5
Runlevel 6
rc
scripts and/or
rc.d
directories for each runlevel
RC Script Naming conventions
Start with S or K
A number
A daemon shell script
Shutting the System Down
Users log out
Services halt
Data is saved
File systems are unmounted
System powers off
Types of shutdowns:
init 0
- no user warning
shutdown [-hcr] time
- warns users before shutting down
halt
and
reboot
- shortcuts for shutdown
CTRL-ALT-DEL - shutdown behavior can be disabled.
Relevant Commands and Files
Commands
Files
init
- Parent of all processes
/etc/inittab
runlevel
- Tell you which runlevel
/etc/rc.d/*
reboot
and
ctrl-alt-del
- Reboots the system
/etc/rc.d/init.d
halt
and
shutdown
- Powers down the system
/etc/rc.d/rc*.d