0% found this document useful (0 votes)
33 views40 pages

Eckert5e ch08

The chapter discusses system initialization in Linux, including booting processes, boot loaders like GRUB and GRUB2, and system initialization using Unix SysV and Systemd. It covers starting and stopping daemons, configuring runlevels, and X Windows components for graphical user interfaces. Localization settings like time zones and language are also configured.

Uploaded by

Stephen Efange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views40 pages

Eckert5e ch08

The chapter discusses system initialization in Linux, including booting processes, boot loaders like GRUB and GRUB2, and system initialization using Unix SysV and Systemd. It covers starting and stopping daemons, configuring runlevels, and X Windows components for graphical user interfaces. Localization settings like time zones and language are also configured.

Uploaded by

Stephen Efange
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Chapter 8

System Initialization, X Windows, and Localization

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. M
ay not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Objectives
• After completing this chapter, you will be able to:
• Summarize the major steps necessary to boot a Linux system
• Detail the configuration of the GRUB boot loader
• Explain the UNIX SysV and Systemd system initialization processes
• Start, stop, and restart daemons
• Configure the system to start and stop daemons upon entering certain
runlevels and targets
• Identify and explain the purpose of the major Linux GUI components: X
Windows, window manager, and desktop environment
• Configure X Windows settings and accessibility options
• Configure time, time zone, and locale information on a Linux system

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The Boot Process (1 of 3)
• Power On Self Test (POST)
• Series of tests run when computer initializes
• Boot loader: program used to load an OS
• Locates and executes the kernel of the OS
• MBR might contain pointer to a partition containing a boot loader on the
first sector
• Active partition: partition pointed to by MBR
• One per hard disk

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The Boot Process (2 of 3)
• Secure boot: digital signature of the boot loader within the UEFI
System Partition is checked first
• Ensures that it has not been modified by malware
• Daemon: system process that performs useful tasks
• Printing, scheduling, and maintenance
• Init (initialize) daemon: first process started
• Loads all other daemons
• Brings system to usable state

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The Boot Process (3 of 3)

Figure 8-1: The boot process

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Boot Loaders
• Boot loader functions
• Primary function: load the Linux kernel into memory
• Passing information to the kernel during startup
• Booting another OS: known as dual booting
• Two most common boot loaders
• GRUB
• GRUB2

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
GRUB Legacy
• Originally created to replace the original Linux boot loader for
hard disks that have an MBR
• Supports the booting of several different operating systems
• Stage1: first major part of GRUB
• Typically resides on MBR/GPT
• Remaining parts of the boot loader (Stage1.5 and Stage2) reside in the
/boot/grub directory
• Stage1.5: loads filesystem support and Stage2
• Stage2: performs the actual boot loader functions
• Displays graphical boot loader screen

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
GRUB (1 of 3)

Figure 8-2: The legacy GRUB boot screen for a Fedora system.

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
GRUB (2 of 3)
• GRUB Legacy configuration
• Edit the /boot/grub/grub.conf file
• Read directly by Stage2 boot loader
• GRUB root partition
• Partition containing Stage2 boot loader and grub.conf file
• GRUB normally allows manipulation of boot loader during system
startup
• To prevent this, password protect GRUB modifications during boot time

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
GRUB (3 of 3)

• If you press any key during first five seconds after the BIOS
POST, you will get a graphical GRUB boot menu screen
• Allows you to manipulate the boot process
• Get a grub> prompt to enter commands
• Help screen provides list of all available commands
• The grub-install command: installs GRUB boot loader
• Typically for reinstallation when GRUB becomes damaged

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
GRUB2 (1 of 2)
• Grand Unified Bootloader version 2 (GRUB2)
• Most common boot loader used on modern Linux systems
• Similar structure to GRUB
• Stage2 loads a terminal-friendly boot loader screen
• Main configuration file for GRUB2 is called grub.cfg
• Stored within the /boot/grub/ (or /boot/grub2/) directory
• When a new device driver needs to be loaded by the boot loader
the package often adds a file to /etc/default/grub.d

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
GRUB2 (2 of 2)
• After modifying the file or adding scripts to the /etc/grub.d
directory
• Run the grub2-mkconfig command to rebuild the /boot/grub/grub.cfg file
• GRUB2 boot loader becomes damaged
• Use the grub2-install command

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Linux Initialization
• The kernel resumes control after Linux is loaded
• Executes first init daemon which then performs a system initialization
process
• Brings the system into a usable state
• Recent Linux distributions have adopted the Systemd system
initialization process
• Older Linux systems used a UNIX standard called SysV
• Systemd is completely compatible with SysV
• Implements new features for management

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Working with the UNIX SysV System
Initialization Process
• Two SysV system initialization processes
• Traditional SysV
• Upstart
• In both systems the init daemon runs a series of scripts to start
other daemons to provide system services
• The init daemon is responsible for starting and stopping daemons after
system initialization

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Runlevels
• Runlevel: defines the number and type of daemons loaded into
memory and executed by the kernel
• Seven standard runlevels (see Table 8-3)
• The runlevel command: displays current and most recent runlevel
• The init command: changes the runlevel on a system

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The /etc/inittab File
• Unless otherwise specified, the init daemon enters the default
runlevel indicated in the /etc/inittab file
• Contains a single uncommented line that configures the default runlevel
• Syntax: id:5:initdefault:

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Runtime Configuration Scripts (1 of 5)
• Runtime configuration (rc) scripts prepare the system
• Bring the system to a usable state
• The init daemon executes script for default runlevel (5)
/etc/rc.d/rc5.d script
• Executes all files that start with S or K in the /etc/rc.d/rc5.d directory

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Runtime Configuration Scripts (2 of 5)
• When user specifies runlevel 5, init daemon runs default script
but executes files in the /etc/rc.d/rc5.d directory
• Each file in an /etc/rc[runlevel].d directory is a symbolic link to a
script that can be used to start or stop a daemon
• Depending on whether the symbolic link filename started with an S (start)
or K (kill/stop)

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Runtime Configuration Scripts (3 of 5)

Figure 8-5: A traditional UNIX SysV


system initialization process

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Runtime Configuration Scripts (4 of 5)
• Linux systems that use the upstart init system
• The /etc/rc.d directories are not used
• The init daemon identifies the default runlevel in the /etc/inittab file
• Directly executes the rc scripts within the /etc/init.d directory
• Each daemon has a separate configuration file within the /etc/init directory
that uses standard wildcard notation to identify runlevels it should be
started or stopped in

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Runtime Configuration Scripts (5 of 5)

Figure 8-6: An upstart system


initialization process

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Starting and Stopping Daemons Manually
• To manipulate daemons after system startup, you can execute
them directly from the /etc/init.d directory with the appropriate
argument (start, stop, or restart)
• The service command: start, stop, or restart daemons within
/etc/rc.d/init.d directory
• The upstart init system also provides the stop, start, and restart
commands

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Configuring Daemons to Start in a Runlevel
• To configure a daemon to start or stop in a particular runlevel:
• Create or modify symbolic links within /etc/rc[runlevel].d directories
• The chkconfig command: view and modify runlevel daemons are
started in
• The chkconfig command is not available in Ubuntu Server 14.04
• Use the update-rc.d command to configure files within /etc/rc[runlevel].d
directories

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Working with the Systemd System Initialization
Process (1 of 4)
• Systemd is similar to SysV
• Can also be used to start, stop, and configure many other OS
components
• Each OS component is called a unit
• Daemons are called service units
• Runlevels are called target units (or targets)

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Working with the Systemd System Initialization
Process (2 of 4)
• Each target maps to a UNIX SysV runlevel
• Poweroff.target = Runlevel 0
• Rescue.target = Runlevel1 (Single User Mode)
• Multi-user.target = Runlevel 2, 3, and 4
• Graphical.target = Runlevel 5
• Reboot.target = Runlevel 6
• Default target on a system with a GUI installed is the
graphical.target
• To configure a different target, update /etc/systemd/system/default.target
symbolic link

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Working with the Systemd System Initialization
Process (3 of 4)

Figure 8-7: A Systemd system


initialization process

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Working with the Systemd System Initialization
Process (4 of 4)
• The systemctl command: used to start and stop daemons, as well
as configure them to automatically start during system
initialization
• Syntax: systemctl restart crond.service
• The systemd-analyze command
• View information about Systemd units

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The X Windows System (1 of 2)
• Linux GUI components
• Many components, each of which works separately from the video
hardware
• Together, GUI components and related programs use over 4GB of storage
space on a typical Linux installation

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
The X Windows System (2 of 2)

Figure 8-8: Components


of the Linux GUI

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
X Windows
• X Windows: core component of Linux GUI
• Provides the ability to draw graphical images in windows that are
displayed on terminal screen
• Sometimes referred to as X server
• X clients: programs that tell X Windows how to draw the graphics
and display the results
• Need not run on same computer as X Windows
• Wayland is a new version of X Windows designed to replace
X.org
• Additional security features and an architecture that makes graphical
application development easier
Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Windows Managers and Desktop Environments
(1 of 2)
• Window manager: modifies look and feel of X Windows
• Can be used alone, or in conjunction with a desktop environment
• Desktop environment: standard set of GUI tools
• Toolkits that speed up process of creating new software
• KDE and GNOME are the most common

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Windows Managers and Desktop Environments
(2 of 2)
• K Windows Manager (kwm): window manager that works under
KDE
• Qt toolkit: software toolkit included in KDE
• GNOME desktop environment: default desktop environment in
most Linux distributions
• Uses mutter window manager and the GTK+ toolkit
• KDE, GNOME, and GNOME-based desktop environments use
system resources, such as memory and CPU time, to provide
their graphical interface

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Starting and Stopping X Windows
• When the init daemon boots to runlevel 5 or graphical.target, gdm
starts
• Displays graphical login screen
• Allows user to choose the desktop environment
• If you use runlevel1 (or rescue.target) or runlevel 2-4, the
GNOME Display Manager is not started by default
• Type startx at a character terminal to start X Windows and the default
window manager

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Configuring X Windows
• X Windows interfaces with video hardware
• Requires information regarding keyboard, mouse, monitor, and video
adapter card
• Normally detected from the associated kernel modules that are loaded at boot time,
but can also be specified within configuration files
• The keyboard type (e.g., English, US layout) is normally specified manually during
the installation process
• You can manually run the system-config-keyboard command to configure keyboard

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Accessibility
• Accessibility of the desktop environment
• Desktop environments configured to suit the needs of users
• Assistive technologies
• Tools used to increase accessibility
• Universal Access utility
• Configures assistive technologies within Fedora 28

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Localization
• Collective settings on a system that are specific to a specific
region within the world
• Time, time zone, language, character set, and keyboard type
• Localization settings are normally chosen during the installation process of
the Linux distribution
• Time localization
• Epoch time: Linux kernel stores time as the number of seconds
• The hwclock command: view or modify the time within the BIOS
• Time information is dependent on the regional time zone
• The timedatectl command” used to view and set time and time zone

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Format Localization
• Different regions may have different formats used to represent
data
• Primarily includes language, but includes conventions used by the region
• Different languages may also have different character sets
• American Standard Code for Information Interchange (ASCII) character
set
• The locale command: displays values for locale variables
• The localectl command: view and change locale settings

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Summary (1 of 3)
• The GRUB boot loader is normally loaded by a standard BIOS
from the MBR/GPT of a hard disk, or by a UEFI BIOS from the
UEFI System Partition
• After the boot loader loads the Linux kernel, a system initialization
process proceeds to load daemons that bring the system to a
usable state
• There are two common system initialization processes: UNIX
SysV and Systemd
• UNIX SysV uses seven runlevels to categorize a Linux system
based on the number and type of daemons loaded in memory

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Summary (2 of 3)
• The init daemon is responsible for loading and unloading
daemons when switching between runlevels and targets
• Daemons are typically executed during system initialization via rc
scripts
• You can use a variety of different commands to start, stop, and
restart daemons following system initialization
• You can use the chkconfig or updaterc.d commands to configure
UNIX SysV daemon startup at boot time, as well as the systemctl
command to configure Systemd daemon startup at boot time

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.
Summary (3 of 3)
• The Linux GUI has several interchangeable components,
including the X server, X clients, window manager, and optional
desktop environment
• X Windows is the core component of the Linux GUI that draws
graphics to the terminal screen
• You can start the Linux GUI from runlevel 3 by typing startx at a
command prompt, or from runlevel 5 by using the GNOME
Display Manager
• Linux has many region-specific settings, including time, date, and
locale

Eckert, Linux+ and LPIC-1 Guide to Linux Certification, 5th Edition. © 2019 Cengage. All Rights Reserved. May
not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

You might also like