Chapter 10 - Managing Processes Flashcards

1
Q

What are the three different process types?

A
  1. Shell jobs
  2. Daemons
  3. Kernel Threads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the “shell job” process type?

A

Shell jobs are commands started from the command line. They are associated with the shell that was current when the process was started. Shell jobs are also
referred to as interactive processes.

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

what is the other name for “shell job” processes?

A

interactive processes

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

What is a “daemon” process type?

A

Daemons are processes that provide services. They normally are started when a computer is booted and often (but certainly not in all cases) run with root
privileges.

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

what is a “kernel thread” process?

A

Kernel threads are a part of the Linux kernel. You cannot manage them using common tools, but for monitoring of performance on a system, it’s important
to keep an eye on them.

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

What is a process and what is a thread?

A

For everything that happens on a Linux server, a process is started. When a process is started, it can use multiple threads. A thread is a task started by a
process and that a dedicated CPU can service.

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

What is a thread?

A

A thread is a task started by a process that a dedicated CPU can service.

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

What is a foreground job?

A

A foreground job means that you cannot do anything on the terminal where the command was started until it is done.
It occupies the terminal it was started from until it has finished its work.

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

How to run a job in the background?

A

Add “&” behind the command

This immediately starts the job in the background to make room for other tasks to be started from the command line.

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

How to move the last job that was started in the background as foreground job?

A

fg command.
If there are multiple jobs running in the background, use the jobs command to see the id and specify the id to move the job to a foreground job

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

Which command to use to temporarily stop a job or pause a job?

A

Ctrl+Z

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

What does CTRL+Z to a running job do?

A

It temporarily stops the job. This does not
remove the job from memory; it just pauses the job so that it can be managed. Once paused, you can continue it as a background job by using the bg command.

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

How to run a continuous job that was paused using CTRL+Z, to background job?

A

bg command

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

What is the key sequence you can use to stop a current job and remove it from the memory?

A

CTRL+C

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

Which key sequence send a End of File character to the current job?

A

CTRL+D

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

What happens when you press CTRL+D on a current job?

A

This key sequence sends the End Of File (EOF) character to the current job. The result is that the job stops waiting for further input so that it can complete what it was currently doing.

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

How are CTRL+C and CTRL+D different?

A

When Ctrl-C is used, the job is just canceled, and nothing is closed properly. When Ctrl-D is used, the job stops waiting for further input and next terminates, which often is just what is needed to complete in a proper way.

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

Which command to use to continue the job that has just been frozen using the Ctrl+Z?

A

bg command

19
Q

Which command Shows which jobs are currently running from this shell

A

jobs command

20
Q

Will the processes started in the background be killed when the parent shell from which they were started is killed?

A

No, background processes will not be killed. Have to use the kill command to kill those processes.

21
Q

Will the processes started in the foreground be killed when the parent shell from which they were started is killed?

A

Yes, when parent shell is killed, or closed all the foreground processes started in that shell will also be killed automatically.

22
Q

what are the two different types of background processes?

A

Kernel Threads and Daemon Processes

23
Q

Most common command to see a list of currently running processes?

A

ps command

24
Q

What happens if you use the ps command without any arguments?

A

Shows only those processes that have been started by the current user.

25
Q

What command to use. to see a for a short summary of the active processes

A

ps aux

26
Q

Which command to use If you are looking for not only the name of the process but also the exact command that was used to start the process.

A

ps -ef

27
Q

Which command shows a hierarchical relationship between the parent and child process?

A

ps fax

28
Q

What is the default priority of all the processes started in linux?

A

20

29
Q

What is the command used if you want a process with adjusted priority?

A

nice

30
Q

What is the command if you want to modify the priority of a currently running process?

A

renice

31
Q

What is the priority values range when using nice and renice commands?

A

-20 to 19
By applying a negative niceness, you increase the
priority. Use a positive niceness to decrease the priority

32
Q

Give an example of the renice command?

A

First you need to know the PID , which you can find using ps command and then use -
renice -n 10 -p 1234 (assuming that 1234 is the PID you just found). And 10 is the priority value.

33
Q

What is the one limitation with changing the priorities of running processes?

A

Regular users can only decrease the priority of a running process. You must be root to give processes increased priority.

34
Q

What are the three different signals that work with all the processes|?

A

■ The signal SIGTERM (15) is used to ask a process to stop.
■ The signal SIGKILL (9) is used to force a process to stop.
■ The SIGHUP (1) signal is used to hang up a process. The effect is that the process will reread its configuration files.

35
Q

How to send SIGTERM signal to a process?

A

kill

36
Q

How to send a SIGKILL signal to a process?

A

kill -9

37
Q

Why is it a bad idea to send SIGKILL signal or use “kill -9” to a process?

A
  1. SIGKILL signal can not be ignored and a process is forcefully killed.
  2. You risk losing data.
  3. Your system may become unstable if other processes depend on the process you have just killed
38
Q

Which command to use to show a list of available signals that can be used with kill.

A

kill -l

39
Q

From top utility, which command to use to send signals to a process?

A

Type top and then type k and then type the process id of the specific process. Then type the signal you want to send. 15 for SIGTERM and 9 for SIGKILL.

40
Q

What are the numerical number representation for SIGKILL and SIGTERM?

A

SIGTERM - 15

SIGKILL - 9

41
Q

How to renice a process from the top command?

A

Type top and then type r and then specify the PID of the process. Enter a positive value to decrease process priority or a negative value to increase process priority..

42
Q

How is the load average expressed as?

A

Load average is expressed as. the number of processes that are runnable state (R) or in blocking state (B)

43
Q

what is the runnable and blocking state of a process?

A

Processes are in a runnable state if they currently are running, or waiting to be serviced.
Processes are in a blocking state if they are waiting for I/O.

44
Q

What is the feature that RHEL 8 offers to monitor system activity?

A

tuned
It offers a daemon that monitors system activity and provides some profiles. use tuned to select the
performance profile that best matches your server’s workload.