| Overview |
| Goal |
To evaluate and control processes running on a LUnix system |
| Objectives |
- List and interpret basic information about processes running on the system
- Control processes in the shell? Session using Bash Job control
- Terminate and control porcesses using Singnals
- Moniror Resource usage and system load due to process activity
|
| Sections |
- Processes
- Controlling Jobs
- Killing Processes
- Monitoring Process Activity
|
| Lab |
Monitoring and managing Linux Process |
Section 1:process
What is process?
A process is a running instance of a launched, executable program. A process consists of:
- An address space of allocated memory,
- Secuirty properties including ownership credentials and privileges
- One or more execution threads of program code, and
- The process state.
An existing (Parent) process duplicates it own address space (fork) to the Create a new (child) process structure. Every new process is assigned a unique process ID (PID) for tracking and security. The PID and the parents? Process ID (PPID) is elements of the new process enviroment. All processes is descendants of the first system process, systemd.
Linux Process states
| Name |
Flag |
kernel-defined State Name and description |
| Running |
R |
Task_running:the process is either executing on a CPU or waiting to run. Process can be executing user routines or kernel routines (system calls), or is queued and ready while in the Running (or Run nable) state. |
| Sleeping |
S |
Task_interruptible: |
| D |
Task_uninterruptible |
| K |
Task_killable |
| Stopped |
T |
task_stopped |
| T |
Task_tracked |
| Zombie |
Z |
Exit_zombie |
| X |
Exit_dead |
Listing processes
The PS command is used to listing current processes. The command can provide detailed process infomation, include:
- The UID which determines process privileges
- Pid
- The CPU and real time already expended
- How much memory the process have allocated in various locations
- The location of process STDOUT, known as the controlling terminal, and
- The current process state
Note:the Linux version of PS supports three option formats, including:
- UNIX (POSIX) options
- BSD Options
- GNU Long Options
For example, Ps-aux not the same as PS aux
Monitoring and managing Linux Processes