Module 9: Managing Linux Processes
user process
A process begun by a user and which runs on a terminal.
foreground processes
A process for which the BASH shell that executed it must wait for its termination.
daemon process
A system process that is not associated with a terminal.
process ID (PID)
A unique identifier assigned to every process as it begins.
top command
Used to give real-time information about the most active processes on the system; it can also be used to renice or kill processes.
pgrep command
Used to list the PIDs of processes that match a regular expression or other criteria.
atrm command
Used to remove a scheduled at job.
Which process has a PID of 1 and a PPID of 0?
init/systemd
Every process has a process ID and a:
parent process ID
The _________ command displays the lineage of a process by tracing its PPID back to the init daemon.
pstree
Which command is used to change the priority of an active process?
renice
Which of the following commands will most likely increase the chance of a process receiving more time slices?
renice -12
What is the default priority of a process?
0
What priority number is assigned to the ps process?
80
cron tables
A file specifying tasks to be run by the cron daemon; there are user cron tables and system cron tables.
Process priority
A number assigned to a process, used to determine how many time slices on the processor that process will receive; the higher the number, the lower the priority.
background processes
A process that does not require the BASH shell to wait for its termination. Upon execution, the user receives the BASH shell prompt immediately.
rogue processes
A process that has become faulty in some way and continues to consume far more system resources than it should.
zombie / defunct process
A process that has finished executing but whose parent has not yet released its PID; the zombie still retains a spot in the kernel's process table.
parent process
A process that has started other processes (child processes).
child processes
A process that was started by another process (parent process).
jobs command
Displays background processes running in the current shell.
pstree command
Displays processes according to their lineage, starting from the init daemon.
True or False: To kill a process running in the background, you must place a % character before its process ID.
False
True or false: If /etc/cron.allow and /etc/cron.deny exist, only users listed in the former can use the cron command and any listed in the latter are denied access to the cron command.
False
pkill command
Used to send a kill signal to processes that match a (same name matched by a regular expression) regular expression or other criteria.
kill command
Used to send kill signals to a process by PID.
atq command
Used to view a scheduled at job.
crontab command
Used to view and edit user jobs scheduled to run with cron.
at command
Used to view, create, and manage scheduled tasks that run at a single instance in the future.
How can you bypass the wait function and send a user process to the background?
You can use the Ctrl+z key combination and the bg command.
Which command is equivalent to the atrm command?
at -d
Which command is equivalent to the atq command?
at -l
Which command will bring a background process in foreground?
fg
Nice values are used to affect process priorities using a range between:
-20 and 19
Which parameter can you use with the ps command to display the active processes?
-A -e
Which directory stores the cron configuration file?
/etc/
In context of cron, which of the following is not the correct directory name?
/etc/cron.yearly/
The ________ file system is a virtual file system that is available in CentOS.
/proc
Where are individual user tasks scheduled to run with the cron daemon stored on a Fedora system?
/var/spool/cron/username
Which command should you run to list the background processes?
jobs
You want to kill all process IDs of a specific process with a single command. Which command should you use?
killall
To view the virtual regions being used, you should use the ________ command.
maps
Which command should be used to change the priority of a process?
nice
To display the processes for the current shell or for a specific user, you should use the ____ command.
ps
process state
The current state of the process on the processor; most processes are in the sleeping or running state.
trap
The process of ignoring a kill signal.
kill signal
The signal sent to a process for use in terminating or restarting processes; different kill signals affect processes in different ways.
at daemon (atd)
The system daemon that executes tasks at a future time; it is configured with the at command
What kill level signal cannot be trapped?
9
Which command is used to schedule jobs?
at
Which metacharacter is used to run a process in the background?
&
Which of the following is used to create a background process?
&
foreground (fg) command
Used to run a background process in the ____________________.
watch command
Used to run a process repeatedly at the specified second interval
lsof (list open files) command
Lists the files that are currently being viewed or modified by processes and users.
Which of the following attributes are associated with a process?
Process ID Parent process ID Current directory PWD File descriptor table
killall command
Sends kill signals to processes by process name.
parent process ID (PPID)
The PID of the parent process that created the current process.
forking
The act of creating a new BASH shell child process from a parent BASH shell process.
time slice
The amount of time a process is given on a CPU in a multiprocessing operating system.
cron daemon (crond)
The system daemon that executes tasks repetitively in the future and that is configured using cron tables.
nice value
The value that indirectly represents the priority of a process; the higher the value, the lower the priority.
When you run the ps command, how are daemon processes recognized?
There is a question mark in the TTY column.
True or False: If /etc/at.allow exists, only users listed in it can use the at command.
True
True or False: If /etc/cron.allow exists, only users listed in it can use the cron command.
True
True or False: If /etc/cron.deny exists and /etc/cron.allow does not exist, any user not listed in /etc/cron.deny can use the cron command.
True
renice command
Used to alter the nice value of a process currently running on the system.
nice command
Used to change the priority of a process as it is started.
nohup command
Used to execute a child process without parent association.
ps command
Used to obtain information about processes currently running on the system.
Which command will list all active processes that are running on a Linux system?
top command
To displays the uptime of a process, you should use the ______ command.
uptime