Must every process group belong to one process session? In other words, is process group a concept which exists only within a process session?
Is there a process group which doesn't belong to any process session? Can a process group not have a session id?
When a process group has been
disowned from a bash shell by the builtin command
does the process group still exist?
do the processes originally in the process group still have the same group id, implying that they still form a process group?
POSIX defines sessions thus:
A collection of process groups established for job control purposes. Each process group is a member of a session. A process is considered to be a member of the session of which its process group is a member. A newly created process joins the session of its creator. A process can alter its session membership; see setsid(). There can be multiple process groups in the same session.
All process groups belong to a session. The concepts aren't dependent though, so I wouldn't say that a process group is a concept which exists only within a session.
Background processes are given their own process group when they're created, so
disowning them doesn't change their process group;
disown only manipulates Bash's job table:
-h] [jobspec ...]
Without options, remove each jobspec from the table of active jobs. If jobspec is not present, and neither the
-roption is supplied, the current job is used. If the
-hoption is given, each jobspec is not removed from the table, but is marked so that
SIGHUPis not sent to the job if the shell receives a
SIGHUP. If no jobspec is supplied, the
-aoption means to remove or mark all jobs; the
-roption without a jobspec argument restricts operation to running jobs. The return value is 0 unless a jobspec does not specify a valid job.