Lesson 8: Managing System Components Flashcards

1
Q

What powers the GUI?

A

The “compositor” in conjunction -> with X-server to GUI -> (x client/ web browser, x client graphics, x client terminal )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the most common user interface?

A

GNOME then KDE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you install additional user interface

A

yum groupinstall “{UI_name}”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you switch UI experience?

A

On the log in screen click settings (gear)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How are services controlled ?

A

The linux kernel starts up it launches the init (older sysvinit now systemd) which starts and manage service.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How would you verify if system is using systemd?

A

Run the command ps (process show)

-aux option shows all processes with user attached

View process PID number 1 which should show systemd

Or check /sbin/init folder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens after systemd loads?

A

It parses the unit files in the /lib/systemd/system directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Where show you make changed to unit files?

A

In the /etc/systemd/system directory which will overwrite what is done in the /lib/systemd/system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command enables you to control the systemd init daemon?

A

system control utility, The syntax of the systemctl command is systemctl [options] [subcommand] [arguments]

Subcommand:

status {service} Retrieve the current status of a service.
enable {service} Enable a service to be started on boot.
disable {service} Disable a service so that it is no longer started onboot.
start {service} Start (activate) a service immediately.
stop {service} Stop (deactivate) a service immediately.
restart {service} Restart a service immediately.
set-default {target} Set the default target for the system to use on boot.
isolate {target} Force the system to immediately change to the provided target.
mask {unit file} Prevent the provided unit file from being enabled or activated, even when done manually.
daemon-reloadReload the systemd init daemon, including all unitfiles.

Options:

  • t {unit file type} Specify the unit file types to perform the operation on.
  • aList all unit files or properties, regardless of state.
  • -no-reload Prevent the reloading of configuration changes when enabling or disabling a service.
  • -no-ask-password Prevent users from being asked to authenticate when performing privileged operations.
  • -runtime Make changes temporary so that they will not be present after a reboot.
  • H {remote host} Execute the operation on the remote host specified by IP address or hostname.
  • -no-pager Prevent the output from being piped into a paging utility.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How does systemd keep track of which services need to run?

A

It looks at the .target files, which defines what is going to get started up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the first script SysVinit run?

A

it runs the rc.init script. The path is /etc/rc.d/rc.init

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many run levels are there and what are they?

A

There are 7:

rc0. d - sys shut down
rc1. d through rc5.d run cat /etc/inittab to check distro docs
rc6. d - sys reboot

Default options:

rc1 - Single user mode (one user can be logged into system)
rc2 - multiuser, without NFS (without networking functions)
rc3 - Full multiuser mode (boots in cmd line interface allows multiple connections, most server run this mode)
rc4 - unused (usually for custom run level)
rc5 - X11 (boots to graphical user interface)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the rc.local file?

A

rc.local is the last script that will be ran in sysvinit and might override others

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you manipulate what run level a service runs on?

A

Use chkconfig, which allow you to turn services on or off for different run levels. It defaults to levels 3 and 5.

chkconfg {service_name} {turn “on” or “off”}

chkconfg {service_name} –level {specify levels} {turn “on” or “off”}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you list services and which levels they are going to execute at?

A

chkconfig –list

chkconfig command is chkconfig [options] [service] [subcommand]

Options:

{service} on Enable a service to be started on boot.
{service} off Disable a service so that it is no longer started on boot.{service} reset Reset the status of a service.
–level {runlevel} Specify the runlevel in which to enable or disable aservice

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you start a service?

A

Use the services command - service {service_name} start

The syntax of the service command is service [options] [service] [subcommand]

Subcommand:

{service} status Print the current state of a service.
{service} start Start (activate) a service immediately.
{service} stop Stop (deactivate) a service immediately.
{service} restart Restart a service immediately.
{service} reload Re-read a service’s configuration files while the service remains running.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How do you check a service status?

A

User the service command - service {service_name} status

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How do you make temporary changes to which run level your system boots up to?

A

run init {run_level_number}

note. you can use the who command to see who is logged into the system before making changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the five different states of the processes life cycle?

A

application gets executed and starts running

Waiting or Sleep interruptible (can wake for several reasons such the resource coming available)

Waiting or Sleep uninterruptible (sleeps for
a time)

Zombie (parent hasn’t cleared it to stop)

Stops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you tell if a process is not working correctly ?

A

top command will show you the top resource consumer in system by default it will sort to CPU consumption

cap M will sort by memory 
cap P will sort by CPU
u {user_name} will show processes that specified user is using
k {process_ID} will kill a process 
q to quit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

what command will help troubleshoot systemd processes at boot up

A

systemd-analyze helps you troubleshoot systemd on your system

-blame looks at at resource caused system to boot slow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How would you list open files?

A

Yes the command lsof

lsof | grep {resource_name}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the command jobs?

A

command jobs shows processes placed to run in back
Use & to place job in background
% {job_number} to reopen a
background command bg {job_number} starts a job that has been placed in the background
foreground command - fg {job_number}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How would you manage processes prioritize?

A

niceness value range from -20 to 19 where -20 is the fastest and 19 is slowest

10 is the default

nice -n {value#} {resource}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Change the priority of a running application?

A

renice -n {niceness#} {PID}

note. need to know process ID PID

26
Q

How would you view the niceness value?

A

Run command top and look at NI value

27
Q

What is the telinit command?

A

The telinit command enables you to switch the current runlevel of the system. The syntax of the telinit command is telinit [options] {runlevel}

On systemd environments, the telinit command will be translated into the appropriate target request. The runlevel command prints the previous and current runlevel of the system, each separated by a space.

28
Q

What does the pgrep command do?

A

pgrep command displays the PID of processes that match any given pattern. The syntax of the pgrep command is pgrep [options] {pattern}

pgrep runs “ps aux” and filters through grep

29
Q

How do you invokes the process table?

A

Use the ps command, the syntax of the ps command is ps [options]

Option:

a List all user-triggered processes.
-e List all processes.
-l List processes using a long listing format.
u List processes along with the user name and start time.
r Exclude processes that are not running currently.
x Include processes without a terminal.
T Exclude processes that were started by any terminal other than the current one.
-U {user name} Display the processes based on the specified user.
-p {PID} Display only the process associated with the specified PID.
-C {command} Display all processes by command name.
–tty {terminal number} Display all processes running on the specified terminal.

30
Q

How to kill a process / application ?

A

kill {PID}

killall {resource_name} will kill child and parent processes

31
Q

What is the path to the container for all of the regional timezones that you can configure the system?

A

/usr/share/zoneinfo/

The individual files are are special files used by the system and one way to change the system’s time zone is by creating a symbolic link to one of these individual time zone files to the /etc/localtime file

32
Q

How would print the date based on the /etc/localtime file?

A

Use the date command, it will print the date in the following format: <24 hour time ##:##:##>

So, Wed Oct 31 15:03:16 GMT 2018

The syntax of the date command is date [options] [format]

Formatting Option

%A The full weekday name.
%B The full month name.
%F The date in YYYY-MM-DD format.
%H The hour in 24-hour format.
%I The hour in 12-hour format.
%j The day of the year.
%S Seconds.
%V The week of the year.
%x The date representation based on the locale.
%X The time representation based on the locale.
%Y The year.
33
Q

How so you set system date and time information?

A

Use the timedatectl command. The syntax of the timedatectl command is timedatectl [options] [subcommand]

Subcommand:

status Show the current date and time information, including local time, universal time, RTC time, time zone, and more. This is the same as issuing timedatectl by itself.

set-time Set the system’s time to the time provided. The formatshould be as follows: 2018-10-31 15:03:16

set-timezone Set the system’s time zone to the time zone provided. Thezone is in the format specified by the /usr/share/zoneinfo structure.

list-timezones List all available time zones in the format specified bythe /usr/share/zoneinfo structure.

set-ntp {0|1}Enable or disable synchronization with a Network TimeProtocol (NTP) server.

Option:

-H {remote host}Execute the operation on the remote hostspecified by IP address or hostname.

–no-ask-passwordPrevent the user from being asked to authenticatewhen performing a privileged task.

–adjust-system-clockSynchronize the local (system) clock based on thehardware clock when setting the hardware clock.

-M {local container}Execute the operation on a local container.

34
Q

What are the three different clocks that the system can use?

A

The timedatectl command exposes three different clocks that the system canuse:

  1. The local clock - his clock reflects the current time in the system’s locale
  2. The universal time. This clock reflects the time irrespective of the local time zone. Ituses the international standard Coordinated Universal Time (UTC), which is thesame as Greenwich Mean Time (GMT)
  3. he hardware clock. As the name implies, this clock functions at the hardware leveland keeps time even when the computer is powered off. The hardware clock is also known asthe real-time clock (RTC).
35
Q

How do you set the hardware clock?

A

Use the hwclock command. The syntax of the hwclock command is hwclock [options]

Option:

–set Set the hardware clock to the provided date and time.

  • u Set the hardware clock to UTC.
  • s Set the system time from the hardware clock.

–adjust Add or subtract time from the hardware clock to account for systematic drift.

36
Q

How do you view and configure the system locale and keyboard layout settings?

A

Use the localectl command. The syntax of the localectl command is localectl [options] [subcommand]

Subcommand:

status Show the current locale and keyboard layout. This is thesame as issuing localectl by itself.

set-locale Set the system locale to the locale provided.

list-locales List all available locales on the system.

set-keymap Set the keyboard layout to the provided layout.

list-keymaps List all available keyboard layouts on the system.

Option:

-H {remote host}Execute the operation on the remote host specifiedby IP address or hostname.

–no-ask-password Prevent the user from being asked to authenticatewhen performing a privileged task.

–no-pager Prevent the output from being piped into a pagingutility.

–no-convert Prevent a keymap change for the console from alsobeing applied to the X display server, and vice versa.

37
Q

What is character encoding and decoding?

A

Character encoding is the process of converting text into bytes, and decoding is theprocess of converting bytes into text.

38
Q

What is X11 or X?

A

Is the X Window System a platform-independent displayserver and windowing system that was developed by the Massachusetts Institute ofTechnology (MIT) in 1984.

39
Q

What is X.Org?

A

X.Org Server is the free and open source reference implementation of the X WindowSystem for Linux and other Unix-like operating systems.

40
Q

What is Wayland?

A

Wayland is both a display server and its reference implementation in Unix-likeoperating systems that is meant to improve upon and replace the X Window System.

41
Q

What are the advantages of Wayland over X?

A

X is unable to always correctly determine which window an event applies to because the separate compositor controls how the window is redrawn through actions like resizing and rotation. Because the compositor and server are one in Wayland, this is not an issue.

In Wayland, the compositor receives events directly from the client, mitigating latency issues.

In Wayland, the compositor receives events directly from the client, mitigating latency issues.

Wayland leverages remote desktop protocols for controlling a GUI environment over a network.

Wayland late the data I/O of each window which helps ensure the security of data.

42
Q

What are the disadvantages of Wayland?

A
  • Screen sharing software tends to work better under X.Org Server than Wayland.
  • Remote desktop software tends to work better under X.Org Server than Wayland.
  • It’s easier to recover from crashes under X.Org Server than Wayland.
43
Q

What’s another name for the a desktop environment?

A

Window manager which is a client to a display server that tells the server how to draw graphical elements on the screen.

44
Q

What are the different types of Remote Desktop Software?

A
  • VNC, cross-platform remote desktop service that enables full remote control of a desktop environment.VNC leverages the Remote Frame Buffer (RFB) protocol.
  • XRDP, free and open source utility that constructs aRemote Desktop Protocol (RDP)-like server for non-Windows systems.
  • NX, cross-platform proprietary remote desktopsoftware that offers support for multi-sessionenvironments and account management. NX isdesigned to work with X.
  • Simple Protocol forIndependent ComputingEnvironments (SPICE), designedspecifically for use in virtual environments, often used by administrators to connect to virtual machines that are hosted by the KVM hypervisor.
45
Q

What is console redirection?

A

Console redirection is the process of forwarding input and output through a serialconnection rather than through any I/O peripherals that are directly attached to thesystem.

46
Q

What are unit files?

A

Unit files are configuration files that systemd uses to determine how it will handleunits, which are system resources that systemd can manage.

47
Q

What are targets in systemd?

A

In systemd, targets are a method of grouping unit configuration files together,typically to represent specific modes of operation.

48
Q

What is the hostnamectl command

A

hostnamectl enables you to view the system’s network hostname and other information about the system’s hardware and the Linux kernel it is running. You can also use this command to change the system’s hostname.

The syntax of the hostnamectl command is hostnamectl [options] [subcommand] [arguments]

49
Q

How do you prevent a process from ending when the user logs off?

A

Use the command nohup, the syntax of the nohup command is nohup {command/script}

50
Q

What is contained in the /proc/cpuinfo file?

A

The /proc/cpuinfo file contains information about the system’s processor.

  • processor —The number of the logical core, starting with 0.
  • vendor_id —The CPU manufacturer.
  • model name —The specific model of CPU.
  • cpu MHz —The logical core’s clock speed, measured out to the thousandths decimal place.
  • cache size —The CPU’s cache size.•flags —Characteristics about the CPU as well as supported features.
51
Q

How do you display the time from when a system started running?

A

Use the uptime command

52
Q

What does the sar command display?

A

The sar command displays system usage reports based on data collected from system activity. The syntax of the sar command is sar [options]

By default it displays CPU usage in various time increments for each category of resource that accessed the CPU reports the data collected every 10 minutes.

53
Q

What can the sysctl command help you troubleshoot?

A

The sysctl command to troubleshoot CPU issues by retrievingCPU-based kernel parameters at runtime.

54
Q

What information does the /proc/meminfo file contain?

A

The /proc/meminfo file contains a great deal of information about the system’smemory usage.

  • MemTotal —The total amount of physical memory on the system.
  • MemFree —The total amount of physical memory that is currently unused.
  • Cached —The total amount of physical memory that is being used as cachememory.
  • SwapTotal —The total amount of swap space on the system.
  • SwapFree —The total amount of swap space that is currently unused.
  • Dirty —The total amount of memory that is waiting to be written to storage.
  • Writeback —The total amount of memory currently being written to storage.
55
Q

What does the free command do?

A

It parses the /proc/meminfo file for easier analysis of memory usage statistics. By default behavior it display the following information about system memory and swap space: total memory, total used, total free, total shared, total buffered and cached, total available for starting new apps (estimated).

The syntax of the free command is free [options]

Options:

  • b, -k, -m, -g, -tera Display memory in bytes, kilobytes, megabytes, gigabytes, and terabytes, respectively.
  • s {seconds} Update memory statistics at a delay of the specified seconds.
  • o Disable the display of the buffered/cached information.
  • t Display a total line that combines physical RAM with swapspace.
  • h Make the output more human-readable.
56
Q

The vmstat command displays various statistics about ______?

A

virtual memory, as well as process, CPU, and I/O statistics.

The syntax of the vmstat command is vmstat [options] [delay [count]]

note. recommended to supply vmstat with a delay for a more accurate report. Forexample, vmstat 5 5 will run the command on a five-second delay for fiveintervals.

57
Q

What Linux kernel feature determines what process(es) to kill when the system is extremely low on memory?

A

The out-of-memory (OOM) killer feature, which will continue to kill processes until enough memory is free for the kernel and the system to run smoothly.

58
Q

What are the three types of swap spaces?

A

Device swap - Device swap space is configured when you partition the storage device. It is used by the operating system to run large applications.

File system swap - File system swap space is configured primarily when you installLinux. It is used by the operating system as an emergency resource when the available swap space runs out.

Pseudo-swap - enables large applications to run on computers with limited RAM.

59
Q

How do you create a swap space on a storage partition ?

A

Use the mkswap command, it is also used to move swap space to a different partition than the one that was created during system installation

Option:

  • c Verify that the device is free from bad sectors before mounting the swap space.
  • p Set the page size to be used by the mkswap command. A page is a chunk of memory that is copied to the storage device during the swap process.
  • L {label}Activate the swap space using labels applied to partitions or filesystems.
60
Q

How do you activate and deactivate a swap partition ?

A

Use swapon command to activate swapoff deactivate

Frequently used swapon and swapoff commands options:

swapon -e Skip devices that do not exist.
swapon -a Activate all of the swap space.
swapoff -a Deactivate all of the swap space.