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?

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.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.