Chapter 10 - Managing Processes Flashcards
What are the three different process types?
- Shell jobs
- Daemons
- Kernel Threads
What is the “shell job” process type?
Shell jobs are commands started from the command line. They are associated with the shell that was current when the process was started. Shell jobs are also
referred to as interactive processes.
what is the other name for “shell job” processes?
interactive processes
What is a “daemon” process type?
Daemons are processes that provide services. They normally are started when a computer is booted and often (but certainly not in all cases) run with root
privileges.
what is a “kernel thread” process?
Kernel threads are a part of the Linux kernel. You cannot manage them using common tools, but for monitoring of performance on a system, it’s important
to keep an eye on them.
What is a process and what is a thread?
For everything that happens on a Linux server, a process is started. When a process is started, it can use multiple threads. A thread is a task started by a
process and that a dedicated CPU can service.
What is a thread?
A thread is a task started by a process that a dedicated CPU can service.
What is a foreground job?
A foreground job means that you cannot do anything on the terminal where the command was started until it is done.
It occupies the terminal it was started from until it has finished its work.
How to run a job in the background?
Add “&” behind the command
This immediately starts the job in the background to make room for other tasks to be started from the command line.
How to move the last job that was started in the background as foreground job?
fg command.
If there are multiple jobs running in the background, use the jobs command to see the id and specify the id to move the job to a foreground job
Which command to use to temporarily stop a job or pause a job?
Ctrl+Z
What does CTRL+Z to a running job do?
It temporarily stops the job. This does not
remove the job from memory; it just pauses the job so that it can be managed. Once paused, you can continue it as a background job by using the bg command.
How to run a continuous job that was paused using CTRL+Z, to background job?
bg command
What is the key sequence you can use to stop a current job and remove it from the memory?
CTRL+C
Which key sequence send a End of File character to the current job?
CTRL+D
What happens when you press CTRL+D on a current job?
This key sequence sends the End Of File (EOF) character to the current job. The result is that the job stops waiting for further input so that it can complete what it was currently doing.
How are CTRL+C and CTRL+D different?
When Ctrl-C is used, the job is just canceled, and nothing is closed properly. When Ctrl-D is used, the job stops waiting for further input and next terminates, which often is just what is needed to complete in a proper way.