I am reading this post:
About pgid
and ppid
it indicates:
PGID
Each process in a process group shares a process group ID (PGID),
which is the same as the PID of the first process in the process group.
This ID is used for signaling related processes.
If a command starts just one process, its PID and PGID are the same.
PPID
A process that creates a new process is called a parent process;
the new process is called a child process. The parent process ID (PPID) becomes associated
with the new child process when it is created. The PPID is not used for job control.
I understand the ppid
and to be honest, seems it is a kind of group, the parent and the children processes, the children were created by the parent process and they are related in someway, right? Correct me if I am wrong. But seems it is correct at a first glance
But about the processes grouped by pgid
Question
- How does Linux create/manage processes assigned through
pgid
?
Extra Questions
- How does Linux decide when a command/process should create a group?
- How does Linux decide when a command/process should be moved to an already created group? Based on what?