Diagnostic and Debugging Tools Flashcards

(24 cards)

1
Q

What are diagnostic and debugging tools used for?

A

To inspect and troubleshoot running processes in Linux.

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

What do these tools provide?

A

Real-time visibility into process behavior.

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

Which tools are included?

A

/proc/<PID>, pstree, lsof, and strace.</PID>

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

What does /proc/<PID> directory reveal?</PID>

A

Information about a specific process.

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

What details can /proc/<PID> show?</PID>

A

Command line, environment variables, memory usage, and open file descriptors.

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

Does /proc/<PID> require additional software?</PID>

A

No, it is built-in and updates live.

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

Example of /proc usage?

A

/proc/2345/status shows memory usage.

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

Another example of /proc usage?

A

/proc/2345/cmdline shows how the process was launched.

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

Why is /proc useful?

A

Diagnosing resource issues.

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

What does pstree command do?

A

Shows hierarchical diagram of processes.

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

What relationships does pstree display?

A

Parent and child relationships.

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

Why use pstree?

A

To track process lineage and investigate zombie processes.

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

Option for pstree to include PIDs?

A

pstree -p.

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

Example of pstree usage?

A

Verify if worker processes were respawned correctly after a web app update.

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

What does lsof command do?

A

Lists all open files and the processes using them.

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

What counts as files in Linux?

A

Sockets, pipes, and devices.

17
Q

Option for lsof to show network sockets?

18
Q

Example of lsof usage for HTTPS?

A

sudo lsof -iTCP:443 -sTCP:LISTEN shows process listening on HTTPS.

19
Q

Example of lsof usage for a host?

A

lsof -i@192.168.1.100 lists connections to a host.

20
Q

Why use lsof?

A

Detect port conflicts, identify unauthorized daemons, verify firewall rules, and map network endpoints to PIDs.

21
Q

What does strace command do?

A

Hooks into a running process or starts one under trace and logs all system calls.

22
Q

What system calls does strace log?

A

open(), read(), write(), connect(), etc.

23
Q

Example of strace usage?

A

strace -e open,connect -p 3456 traces access attempts.

24
Q

Why use strace?

A

To find missing files, detect misconfigured permissions, diagnose subtle I/O errors, and gain detailed insight beyond logs.