Process Groups

Overview

A process group is a collection of one or more processes. Every process belongs to exactly one process group, identified by a process group ID (PGID). The process that creates a process group and whose process ID becomes the process group ID is designated as the process group leader.

Sessions

A session is a collection of one or more process groups. Every process within a process group must be part of the same session, identified by a session ID (SID). The process that creates a session and whose process ID becomes the session ID is designated as the session leader.

Controlling Terminal

Every process in a session shares at most one controlling terminal. Upon creation, a session has no controlling terminal. The controlling terminal is established when the session leader first opens a terminal that is not already the controlling terminal for another session.

When a session leader opens a controlling terminal, it in turn becomes the controlling process for the terminal. This is the process that receives a SIGHUP when a terminal disconnects.

At any point in time, exactly one of the process groups in a session is the foreground process group for the terminal. Others are background process groups.

Powered by Forestry.md