Processes and System Monitoring

Observe identity, collect child results, and investigate deviations with context.

A process has more than a name

Field Question
PID Which current process?
PPID Which parent?
Owner Under which account?
State Runnable, sleeping, stopped, or terminated awaiting reap?
Command and executable What is running, from where?

A familiar name does not establish trusted identity. PIDs can be reused.

Signal only the child you created

sleep 30 &
child=$!
kill -TERM "$child"
wait "$child"
status=$?

The complete lesson handles diagnostics and cleanup. Expected wait status for this TERM case: 143.

Do not copy a fixed PID or kill everything found on a port. A successful signal request is not the child's final result.

Job identity and process identity differ

A shell-local job number such as %1 is not a PID.

The automated examples retain each $! and wait for every child, including a failing worker. Interactive Ctrl+Z, jobs, bg, and fg require a controlling terminal and are a separate VM activity.

Backgrounding does not make a durable service or collect every failure automatically.

Match the state field

101 S normalZname
102 Z finished_child
103 R worker
awk '$2 ~ /^Z/ { print "zombie-state pid=" $1 }' states.txt

Expected: zombie-state pid=102. A Z in a name is not a zombie. Its parent must collect the terminated child's status.

Resource measurements have distinct scopes

Observation Scope
df -Pk path Filesystem capacity in 1024-byte units
du -sk directory Directory-tree disk usage
RSS Resident process memory, possibly shared
VSZ Virtual address-space size
Available memory Tool/platform-defined estimate, not simply free memory

The lessons capture actual bounded snapshots; fixed arithmetic fixtures are labeled synthetic.

Load average is not CPU utilization

Linux load averages include runnable tasks and uninterruptible-sleep tasks over different time windows.

A synthetic load of 2.50 on two logical CPUs gives a ratio of 1.25. It does not prove 125% CPU utilization or distinguish CPU pressure from blocked I/O.

Collect a separate CPU measurement and relevant I/O observations before diagnosing a bottleneck.

A baseline difference is a question

The fixture baseline contains backup_worker and web_worker; the current set adds review_worker.

A sorted set comparison reports the addition. It does not establish executable identity, owner, authorization, or compromise.

Preserve raw fields and timestamps. Distinguish observation, hypothesis, and the next check.

Consolidate on your VM

Then complete the graded lab.

Investigate a student-owned process, preserve a bounded snapshot, collect its final status, and write the limits of your conclusion. Record actual PIDs, sampling intervals, units, and scope.

Sources: Linux process/load references and Linuxize material linked in the lessons. All signal fixtures are owned children; no host service is terminated.