0

I have read here that it is mandatory for a process group to belong to a session.

But is it also mandatory for a process to belong to a process group?

Joseph
  • 375

1 Answers1

3

I think it is not so much "mandatory" as it is "unavoidable". A new process is automatically a member of its parent's process group. The only way to leave the process group is to either exit, or create a process group, in which case the creator is automatically moved from its current group to the newly created group. (Note that a new group can be created either by creating a new session or by creating a new group in the current session.)

(The same would be true of process groups; a new process group is created within the current session or as the initial group of a new session. There's no way to create a "naked" process group.)

chepner
  • 7,501