Module 4 Flashcards
Red Hat
4 Linux Process States
1) Running (R)
2) Sleeping (S, D, K, & I)
3) Stopped (T, T)
4) Zombie (Z, x)
Linux Process - Running State (R)
R - TASK_RUNNING: The process is either executing on a CPU or waiting to run. The process can be executing user routines or kernel routines (system calls), or be queued & ready when in the “Running” (or Runnable) state.
Linux Process - Sleeping State (S)
TASK_INTERRUPTIBLE: The process is waiting for some condition: a hardware request, system resource access, or a signal. When an event or signals satisfies the condition, the process returns to Running.
Linux Process - Sleeping State (D)
TASK_INTERRUPTIBLE: This process is also sleeping, but unlike the “s” state, does not respond to signals. It is used only wen process interruption might cause an unpredictable device state.
Linux Process - Sleeping State (K)
TASK_KILLABLE: Same as the interruptible “D” state, but modified to allow a waiting task to respond to the signal to kill it (exit completely). Utilities often display “Killable” processes as the “D” state.
Linux Process - Sleeping State (I)
TASK_REPORT_IDLE: A subset of state “D”. The kernel does not count these processes when calculating the load average. It is used for kernel threads. The TASK_INTERRUPTIBLE & TASK_NOLOAD flags are set.
It is similar to TASK_KILLABLE, & is also a subset of state “D”. It accepts fatal signals.
Linux Process - Stopped State (T1)
TASK_STOPPED: The process is stopped (suspended), usually by being signaled by a user or another process. The process can be continued (resumed) by another signal to return to running.
Linux Process - Stopped State (T2)
TASK_TRACED: A process that is being debugged is also temporarily stopped & shares the “T” state flag
Linux Process - Zombie State (Z)
EXIT_ZOMBIE: A child process signals to its parents as it exits. All resources except for the process identity (PID) are released.
Linux Process - Zombie State (x)
EXIT_DEAD: When the parents cleans up (reaps) the remaining child process structure, the process is not released completely. This state cannot be observed in process-listing utilities.
What are the Fundamental Process Management Signals?
1) 1
2) 2
3) 3
4) 9
5) 15 (default)
6) 18
7) 19
8) 20
Signal 1
HUP
Hangup: Reports termination of the controlling process of a terminal. Also requests process re-initialization (configuration reload) w/o termination.
Signal 2
INT
Keyboard interrupt: Causes program termination. It can be blocked or handled. Sent by pressing the INTR (interrupt) key sequence (Ctrl+c)
Signal 3
QUIT
Keyboard quit: Similar to SIGINT; adds a process dump at termination. Send by pressing the QUIT key sequence (Ctrl+)
Signal 9
KILL
Kill, unblockable: Causes abrupt program termination. It cannot be blocked, ignored, or handled; consistently fatal.
Signal 15 (default)
TERM
Terminate: Causes program termination. Unlike SIGKILL, it can be blocked, ignored, or handled. The “clean” way to ask a program to terminate; it allows the program to complete essential operations & self-cleanup before termination
Signal 18
CONT
Continue: Sent to a process to resume if stopped. It cannot be blocked. Even if handled, it always resumes the process.
Signal 19
STOP
Stop, unblockable: Suspends the process. It cannot be blocked or handled
Signal 20
TSTP
Keyboard stop: Unlike SIGSTOP, it can be blocked, ignored, or handled. Sent by pressing the suspend key sequence (Ctrl+z)
Keyboard Control sequence to Suspend
Ctrl+z
Keyboard Control sequence to Kill
Ctrl+c
Keyboard Control sequence to Core Dump
Ctrl+\
Default action - Term
Terminate a program (exit) immediately
Default action - Core
Save a program’s memory image (core dump), & then terminate
Default action - Stop
Stop a running program (suspend) & wait to continue (resume)
Fundamental Keystroke in “top” Command - “?” or “h”
Help for interactive keystrokes
Fundamental Keystroke in “top” Command - “l, t, m”
Toggles for load, threads, & memory header lines
Fundamental Keystroke in “top” Command - “I” (capital “eye”)
Toggle for individual CPUs or a summary for all CPUs in the header
Fundamental Keystroke in “top” Command - “s”
Change the refresh (screen) rate, in decimal seconds (0.5, 1, 5)
Fundamental Keystroke in “top” Command - “b”
Toggle reverse highlighting for “Running” processes; the default is bold only
Fundamental Keystroke in “top” Command - Shift+b
Enables bold use in display, in the header, & for “Running” processes
Fundamental Keystroke in “top” Command - Shift+h
Toggle threads; show process summmary or individual threads
Fundamental Keystroke in “top” Command - “u”, Shift+u
Filter for any username (effective, real)
Fundamental Keystroke in “top” Command - Shift+m
Sort process listing by memory usage; in descending order