Chapter 6 (Managing Processes) Flashcards
—– are messages that can be sent between processes
Signals
—– are messages that can be sent between processes
Signals
A Linux — is a program that is running on the system. It can be started either from a command line, a graphical desktop, the kernel itself.
Process
Every process on Linux is assigned a —- which is a unique number identifying a process with the Linux Kernel.
Process ID (PID)
(Process States) The process is executing,though it must wait for it assigned time slices and must pause for a few microseconds between steps in the execution.
Running
(Process States) The process is waiting for something to happen that doesn’t depend on the kernel giving it another time slice.
Sleeping
(Process States) the process has been halted before it exited normally.
Stopped
(PS States) the process has been halted before it exited normally.
Stopped
Swap space is also called
Virtual memory
—- Occurs when the kernel spends so much time moving processes to and from the swap space that the kernel and the processes bog down and work inefficiently.
Thrashing
A Linux — is a program that is running on the system. It can be started either from a command line, a graphical desktop, the kernel itself.
Process
Every process on Linux is assigned a —- which is a unique number identifying a process with the Linux Kernel.
Process ID (PID)
To create a new process in Linux, a program —-
Forks
(PS States) The process is executing,though it must wait for it assigned time slices and must pause for a few microseconds between steps in the execution.
Running
(PS States) The process is waiting for something to happen that doesn’t depend on the kernel giving it another time slice.
Sleeping
— is a background process that doesnt have any screen output but waits for certain system activity and then acts on it.
daemon
(PS States) A — process is a process that is no longer active.
Zombie
Swap space is also called
Virtual memory
—- Occurs when the kernel spends so much time moving processes to and from the swap space that the kernel and the processes bog down and work inefficiently.
Thrashing
(PS Options)Selects all processes that were not started normally from a terminal
x
Multiple processes started from a single shell are called —
Jobs
You can use the — key combo to suspend a job that the shell is busy running.
Ctrl+z
You can use the — key combo to suspend a job that the shell is busy running.
Ctrl+z
To place a job in the foreground use the – commmand
fg
Use the — command to run the suspended program in the background
bg
The – command lists the processes that are currently running on your Linux system.
ps
The – command lists the processes that are currently running on your Linux system.
ps
To see a list of all the signals, use the kill command with the -l option
S kill -l
— is a background process that doesnt have any screen output but waits for certain system activity and then acts on it.
daemon
(PS Options) You can use the - option to display the relationship between different processes, showing which processes start other processes.
f
(PS Options) Selects all processes on the system
-A
(PS Options) Selects all processes running in the current terminal
T
— requests that a program close itself, giving the program a chance to clean up its work, close any open files, and so forth, before ending.
SIGTERM
(PS Options) Restricts output to running processes (those that are not sleeping)
r
If the myeditor program were behaving badly, you could use this command
killall -9 myeditor
(PS Options) Selects processes by PID number
-p
(PS Options) Selects processes by user name; to use this option, type the user name after the option
–user
(PS Options) Selects all processes belonging to users who are members of the group named after the option
–group
The — field provides a cumulative measure of the amount of CPU time consumed by a process.
Time field
The — is a collection of information about the Linux Kernel that you access as if it were actually data files stored in subdirectories of /proc
/proc file system
(Example) To start a script named analyze with a nice level of 5, use this command
$ nice -5 analyze
Top is normally started without any options, like this
$ top
(Example) if the PID of the analyze script is 1776, this renice command changes the running script’s priority to 10 so that it takes longer to complete
renice +10 1776
To see a list of all the signals, use the kill command with the -l option
S kill -l
Almost all programs respond to the — signal (#15) This signal requests that the program end.
SIGTERM
Shuts down the indicated process
SIGKILL
(Interactive Commands in top) Change the number of processes included in the display
n or #
— requests that a program close itself, giving the program a chance to clean up its work, close any open files, and so forth, before ending.
SIGTERM
This command sends a signal to all processes started by a given command
killall
If the myeditor program were behaving badly, you could use this command
killall -9 myeditor
— determines how much CPU time is granted to the process as the kernel allocates time slices among all processes.
Priority
Another name for the priority of a process is —
nice level
The standard nice level is -
0
The highest nice level, which makes the program run the slowest is –
20
The root user can lower the nice level of a process to – which gives that process a lot of extra CPU time
-20
(Example) To start a script named analyze with a nice level of 5, use this command
$ nice -5 analyze
The — command changes the nice level of a process that is already running. To use the — you must know the PID of the process you want to affect.
renice
(Example) if the PID of the analyze script is 1776, this renice command changes the running script’s priority to 10 so that it takes longer to complete
renice +10 1776
(Interactive Commands in top) Update the process list display immediately
Spacebar
(Interactive Commands in top) Show a help screen with a command or listing
h or ?
(Interactive Commands in top) Kill a process
k
(Interactive Commands in top) Change the number of processes included in the display
n or #
Renice a process
r
A program called — lets you view system status information on your desktop continuously
GKrellM
A — contains prewritten functionality that any program can use
library
— Include library functions in the main program. They require no additional library files on the Linux system. Each copy of an application loads into system memory a duplicate copy of all the library functions it uses
Statically linked applications
— means that several applications can use a single copy of a library that has been loaded into memory.
Shared Libraries
(Note) Running multiple applications that are dynamically linked to the same libraries requires less memory than running multiple statically linked applications.
/
You can use the — command to list all the libraries that a program requires.
ldd
(Combinations of Process information Fields available from ps)
Shows fields related to controlling jobs in a shell
i
(Combinations of Process information Fields available from ps)
Shows fields related to signals that each process handles
s
(Combinations of Process information Fields available from ps)
Shows fields that define how the owner of each process is using system resources
u
(Combinations of Process information Fields available from ps)
Shows fields detailing how each process is using virtual memory
v
(Column Heading in ps output)
Process Group ID
PGID
(Column Heading in ps output)
Session ID
SID
(Column Heading in ps output)
Controlling Terminal
TTY
(Column Heading in ps output)
Process group ID of the owner of the terminal running the process
tpgid
(Column Heading in ps output)
Owner of the process
user
(Column Heading in ps output)
Time left of a possible timeslice allocated to the process
pri
(Column Heading in ps output)
Nice level
nice
(Column Heading in ps output)
Scheduling Policy
plcy
(Column Heading in ps output)
Real-time priority
rpri
(Column Heading in ps output)
Number of major faults loading information from a file system.
majflt
(Column Heading in ps output)
Number of minor faults (with no disk access involved)
minflt
(Column Heading in ps output)
Size of the text used by the program (in kb)
trs
(Column Heading in ps output)
Size of the data used by the program (in kb)
drs
(Column Heading in ps output)
Virtual image size of the process (in kb)
size
(Column Heading in ps output)
Space used on swap device by this process (in kb)
swap
(Column Heading in ps output)
Kilobytes of the program resident in memory
rss
(Column Heading in ps output)
Shared memory size in kb
share
(Column Heading in ps output)
Number of pages of imformation that are dirty (not yet updated to the hard disk)
dt
(Column Heading in ps output)
State of the process
stat
(Column Heading in ps output)
process flags
Flags
(Column Heading in ps output)
Kernel function at the point where the process is sleeping
wchan
(Column Heading in ps output)
User ID of the owner of this process
uid
(Column Heading in ps output)
Weighted percentage of cpu time consumed
wpcpu
(Column Heading in ps output)
Percentage of cpu used since last update
pcpu
(Column Heading in ps output)
Percentage of memory used
pmem
(Column Heading in ps output)
Time that the process was started
start
— — let you log in at multiple independent text-mode screens
Virtual consoles
(Note)
Multiple processes can be started from a single shell. Starting a process with a ampersand runs the program in the background.
/
You can view process information within the /proc file system or using a number of utilities such as – and —
Ps and top
— opens your crontab in a text editor.
Crontab -e
Two daemons — and — are started when you boot Linux using standard service scripts in /etc/ex.d/init.d
ATF and cond
The — command lists all queued at jobs.
Atq
Use the — command to cancel a command that you have submitted using at.
Atrm
The — variable defines which shell the crond daemon uses to execute the commands and scripts listed in a file.
Shell
The — variable defines which user on the Linux system receives a email message about containing the output from all corn jobs defined in the file.
Mailto