Posts

Complete life cycle of the process - Linux

Image
So Complete life cycle of the process can be circle as - Spawn Waiting  Runnable Stopped Zombie  # ps -o pid, state, command PID  S Command  1661 S sudo su -  1662 S su - 1663 S -bash  1713 R ps -o pid, state, command   In the above output, you can see a column titled S shows the state of a process. We have here 3 sleeping and one running process. Let's dive into each state. Process state: Running  The most healthy state of all. It indicates the process is active and serving its requests. The process is properly getting system resources(especially CPU) to perform its operations. Running process is a process which is being served by CPU currently. It can be identified by state flag R in ps or top output. The runnable state is when the process has got all the system resources to perform its operation except CPU. This means the process is ready to go once the CPU is free. Runnable processes are also flagged with state flag R. Process state: Sleeping...