(Process relationship) process Group, session

Source: Internet
Author: User

Control Terminal: When the user lifts, the init process is created and the process number is 1. The creation of Init puts the system into multi-user state. for each device that is allowed to log on, the intit process uses the fork once, which generates executes the EXEC (Getty) Program on the child process.
the login program then performs the following actions: 1. Set the current working directory as the user's starting directory (CHDIR)
2. Call Chown to change the user ownership of the terminal, so that the login user becomes its owner.
3. Set the access rights of the terminal device to read and write.
4. Call Setgid and initgroups set the group ID of the process5. Start the environment with all the information from login: Start directory (HOME), Shell (shell), username (user and logname), and a system default path (PATH). 6. The login process changes to the user ID (setuid) of the logged-in user and invokes the user's login shell. as followsexecl ("/bin/sh", "-sh", (char*) 0).

Process Group:a process group is a collection of multiple processes.
Each process group has a leader process, and the ID of the leader process is the same as the ID of the process group.
The process group ID of the Setgpid (pid_t pid,pit_t pgid) function PID process is set to Pgid. If these two numbers are equal, then the process specified by the PID becomes the leader process, but the process only assigns the leader process to itself or its child processes. If pid=0, the caller's ID is used. If pgid==0, the process ID specified by the PID is used as the leader ID. In most job control shells, the fork
session:A session is a collection of multiple processes or process groups.



























From for notes (Wiz)

(Process relationship) process Group, session

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.