Linux Process Group session control terminal These are easy to stun, record, prevent forgetting
1 process
Personal understanding process is a program running in memory PID is the process ID
2 Process Groups
As the name implies, is a set of processes, they are not isolated, ken that there is a parent-child or process relationship, note that the Linux process is a tree-like organization,
Each process must belong to a process group, or only one process group, and there are multiple processes within the process group
Each process group has a leader, and the PID of the lead process is the integration group ID, which is Pgid
Eg:ps-o Pid,pgid,ppid,sid,comm | More
Can be seen in:
Ps
Bash-"fork-"
Cat
PS and cat make up the integration group, PS is leader, leader can end first, process rent other processes to hold just the pgid, until the integration group all processes are exited
Can send signals to process groups via Kill-sigteam
Use Pstree to view process relationships,
3 jobs
The shell is not a process but a job or a process group that controls the front and back of the table. a foreground job can consist of multiple processes, and a background can be composed of multiple processes ,
the shell can run a foreground job and any number of background jobs, called job control . Bash supports job control, SH does not support
The difference between a job and a process group: If a process in the job has created a child process, the child process does not belong to the job. Once the job runs, the shell mentions itself to the foreground, and if the original foreground process still exists (if the child process has not yet terminated), it automatically becomes the background process group.
You can put the process in the background by adding & at the end
By job in front desk, specific use please Google
4 Sessions
Multiple process group groups can constitute a session, where the session is created by a process called session Leader,session leader PID becomes the SID of the session
A session can have multiple process groups, but only one foreground process group, others are background process groups, each session can connect to a control terminal, and can only connect to one terminal, terminal has input and output, and is uploaded to the process session group
Linux Process Group job session control terminal