Linux is a multi-user multitasking operating system that must support multiple users to log on to the same operating system at the same time.
When a user log on to a terminal will produce a session , each session has a session of the first process, that is, the process of creating a session, the establishment and terminal connection is the session first process , also known as the control process. A session can include multiple process groups, which can be divided into one foreground process group and one or more background process groups.
Why are you so divided? The foreground process group refers to the group of processes that need to interact with the terminal (only one), for example, some processes need to complete IO operations, the process is then set to the foreground process group. When we type the interrupt key and exit key for the terminal, the signal is sent to all processes in the foreground process group. A background process group is a group of processes that do not need to interact with a terminal process, for example, some processes do not need to complete IO operations, or some daemons are set up as background process groups.
References: http://blog.csdn.net/yh1548503342/article/details/41891047