Process Management Flashcards

1
Q

What is a program?

A

a set of written instructions, stored in a system.

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

Could you explain the concept of a process?

A

a running instance of a program.

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

What are the various states that Linux processes can assume?

A

Running
Stopped
Zombie
Sleeping
Terminated
Uninterrupted Sleep

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

Can you elaborate on what interactive processes entail?

A

a process which acts on user input, example using -f with rm

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

How would you define a daemon process?

A

a process that is continuously running in the background and manages a particular task or service.

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

What steps allow a process to be moved to the background?

A

use &amp to send a process
into the background

for e.g. sleep 200 &.

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

How can a process be brought to the foreground?

A

jobs to get job id. then fg %jobid.

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

Which command is used to inspect background processes?

A

jobs

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

What purpose does the ps -aux command serve?

A

indicates the running processes along with the resources they are using. %cpu, %memory, time, state, terminal. unix based command

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

How is it possible to terminate a background process?

A

jobs -l to get pid/jobid
kill %jobid or
kill -9 pid or kill -15 pid

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

What is the method to list all active processes?

A

ps -ef

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

Is there a command to display a process and its child processes?

A

pstree <username> and/or
pgrep -l <processname>

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

How can a process be terminated using its name?

A

pkill <processname>

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

What sets apart the SIGTERM and SIGKILL signals?

A

SIGTERM kills the process gracefully, SIGKILL kills the process abruptly or forcefully.

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

Which signal enables a process to continue running even after the shell exits?

A

nohup – no hang
up.

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

What is a zombie process, and how does it occur?

A

a terminated child process that remains in the system’s process table while waiting for its parent process to collect its exit status

17
Q

Could you elucidate the distinctions between processes and threads?

A

processes are heavy
weight (more resources), processes do not share memory

threads share resources, memory,
threads are lighter (less resources). threads are a part of process.

18
Q

What approach would you use to search for the "httpd" process among active processes?

A

ps -
ef | grep httpd or pgrep -l httpd

19
Q

How can you determine the total count of active processes on the system?

A

ps -ef | wc -l

20
Q

In gracefully terminating a process, which signal is invoked by -15?

A

SIGTERM

21
Q

For abruptly ending a process, which signal is typically employed?

A

SIGKILL

22
Q

What is the intended purpose of the pkill command?

A

kills the process by name.

23
Q

How might one list all processes associated with the user "robert"?

A

ps -ef
| grep <username>

24
Q

Are you familiar with the concept of the OOM Killer and its intended purpose?

A

processes utilize memory, system crashes if memory is full, to avoid this system crash there is a phenomenon called Out Of Memory – it will kill the process that is least active and taking up memory, kills the process to create memory for important processes. it kills according to the nice value. usually OOM killer is kept inactive. a mechanism in place in the system, when the system runs out of RAM, it kills unnecessary processes.