Linux Process Group job session control terminal

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.