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