RH124 Chapter 8
job control
A feature of the shell which allows a single shell instance to run and manage multiple commands
foreground process
A job that can read input and keyboard generated signals from a particular terminal window.
load average
A measure provided by the Linux kernel that is a simple way to represent perceived system load over time.
background process
A member of any other job associated with a terminal that cannot read input or receive keyboard generated interrupts from the terminal but may be able to write to the terminal.
> 1
A perCPUload that indicates resource saturation and some amount of process delay (< 1 or > 1?)
< 1
A perCPUload that is satisfactory resource utilization and minimal wait times (< 1 or > 1?)
TASK_TRACED
A process that is being debugged is also temporarily stopped and shares the same T state flag.
process
A running instance of a launched executable program. It has an address space of allocated memory, security properties, one or more execution threads of program code and a state.
TASK_REPORT_IDLE
A subset of state D. The kernel does not count these processes when calculating load average. Used for kernel threads. Flags TASK_UNINTERRUPTABLE and TASK_NOLOAD are set. Similar to TASK_KILLABLE, also a subset of state D. It accepts fatal signals.
systemd
All processes are descendants of the first system process called...
process group
All processes in the pipeline are part of the job and members of the same ____________.
&
Append this character to the end of the command line to start a command in the background
effective user ID
By default, ps with no options selects all processes with the same ________ as the current user, and which are associated with the same terminal where ps was invoked.
ps j
Command that display info related to jobs such as PPID, PID, PGID, SID, etc
lscpu
Command that tells you info about CPU including # of CPUs the machine has.
fg
Command to bring a background job to the foreground given its job ID
ps aux
Command to display ALL processes including processes without a controlling terminal
jobs
Command to display a list of jobs that Bash is tracking for a particular session.
uptime
Command to display current load average. Displays current time, how long machine has been up, how many user sessions are running, and current load average (1, 5, and 15 min)
top
Command to display process information that dynamically updates
kill -l
Command to list the names and numbers of all available signals.
w
Command to list user logins and current running processes.
pgrep
Command to search for processes
kill
Command to send a signal to a process by PID number. It can be used to send any signal; not just ones to terminate programs.
pkill
Command to send a signal to one or more processes which match selection criteria such as command name, uid, gid, parent, and terminal running on.
killall
Command to signal multiple processes based on their command name
bg
Command to start a suspended process running in the background
pstree
Command to view a process tree for the system or a single user
ps
Command used for listing current processes including: -UID -PID -CPU and real time expended -Memory allocated to process -Location of process stdout -Current process state
CONT(18)
Continue. Sent to a process to resume, if stopped. Cannot be blocked. Even if handled, always resumes the process.
Zombie
EXIT_ZOMBIE (Z), EXIT_DEAD (X)
job
Each pipeline entered at a shell prompt
HUP(1)
Hangup. Used to report termination of the controlling process of a terminal. also used to request process reinitialization (configuration reload) without termination. [Short Name(Sig #)]
load number / # of logical CPUs
How do you calculate perCPUload to determine if the system is experiencing significant waiting?
pgrep -l -u bob
How would you find all processes owned by user named "bob"?
pkill -SIGKILL -P 8391
How would you kill all processes that are the children of process ID 8391?
TASK_KILLABLE
Identical to the uninterruptible D state, but modified to allow a waiting task to respond to the signal that it should be killed (exit completely). Utilities frequently display killable processes as D state.
suspended
If a running background job tries to read from the terminal, it will be automatically __________.
ttyN
If the device name for a TTY is of the form _________ the logged-in user is on a system console, alternate console, or other directly connected terminal device.
pseudo-terminal
If the device name for a TTY is of the form pts/N it is a _____________________ associated with a graphical terminal window or remote login session of a logged-in user.
Ctrl+z
Keyboard command to suspend and send a foreground job to the background
INT(2)
Keyboard interrupt. Causes program termination. Can be blocked or handled. [Short Name(Sig #)]
QUIT(3)
Keyboard quit. Similar to SIGINT; adds a process dump at termination. [Short Name(Sig #)]
TSTP(20)
Keyboard stop. Unlike SIGSTOP, can be blocked, ignored, or handled.
KILL(9)
Kill, unblockable. Causes abrupt program termination. Cannot be blocked, ignored, or handled; always fatal. [Short Name(Sig #)]
sleeps, wait
Normally, a parent process __________ while the child process runs, setting up a request (________) to be signaled when the child completes. (2 answers, comma separated)
load number
Number collected every 5 sec by kernel, based on the number of processes ready to run (state=R) and waiting for I/O to complete (state=D)
scheduled kernel threads
Processes in brackets (usually at the top of the ps list) are _______________.
Core
Signal default action that causes a program to save a memory image (core dump), then terminate.
Stop
Signal default action that causes a program to stop executing (suspend) and wait to continue (resume).
Term
Signal default action that causes a program to terminate (exit) at once.
STOP(19)
Stop, unblockable. Suspends the process. Cannot be blocked or handled.
Sleeping
TASK_INTERRUPTIBLE (S), TASK_UNINTERRUPTIBLE (D), TASK_KILLABLE (K), TASK_REPORT_IDLE (I)
Running
TASK_RUNNING (R)
Stopped
TASK_STOPPED (T), TASK_TRACED (T)
TERM(15)
Terminate. Causes program termination. Unlike SIGKILL, can be blocked, ignored, or handled. The "polite" way to ask a program to terminate; allows self-cleanup. [Short Name(Sig #)]
environment
The local and global variables, a current scheduling context and allocated system resources for a process.
Controlling terminal
The location of process stdout
TASK_STOPPED
The process has been stopped (suspended), usually by being signaled by a user or another process. The process can be continued (resumed) by another signal or return to running.
TASK_RUNNING
The process is either executing on a CPU or waiting to run. It can be executing user routines or kernel routines or be queued and ready when in this state.
TASK_INTERRUPTIBLE
The process is waiting for some condition: a hardware request, system resource access, or signal. When an event or signal satisfies the condition, the process returns to running.
system daemons
These processes are started by the system and not from a shell prompt. They don't have a controlling terminal, not members of a job, and cannot be brought to foreground. (ps displays a (?) question mark in the TTY column)
TASK_UNINTERRUPTIBLE
This process is also sleeping, but unlike s state, does not respond to signals. Used only when process interruption may cause an unpredictable device state.
SIGKILL
To kill all of a user's processes and login shells, what signal is required?
root priviledge
Users may kill their own processes, but ____________________ is required to kill processes owned by others (two words).
Ctrl+c
What is the keyboard sequence for keyboard interrupt?
Ctrl+\
What is the keyboard sequence for keyboard quit?
Ctrl+z
What is the keyboard sequence for keyboard stop?
0.73
What is the per CPU load for a load average of 2.92 on a machine with 4 logical CPUs?
job number, PID
What two things are returned when a command is run in the background? (2 answers, comma separated)
disk and network
When experiencing high load averages with minimal CPU activity, examine ___________________ activity. (3 words)
EXIT_DEAD
When the parent cleans up (reaps) the remaining child process structure, the process is now released completely. This state will never be observed in process-listing utilities.
EXIT_ZOMBIE
A child process signals its parent as it exits. All resources except for the process identity (PID) are released.
fork
A child process inherits security identities, previous and current file descriptors, port and resource privileges, environment variables and program code from a parent process.
