1

I have read that when Process A start Process B, then Process B will inherit Process A's Process Group ID.

I tested this by making bash execute the cat program, but I found out that bash and cat had two different Process Group ID, why is that?

Steve
  • 827
  • 1
  • 9
  • 15
  • Is this of any help? https://unix.stackexchange.com/questions/139222/why-is-the-pgid-of-my-child-processes-not-the-pid-of-the-parent?rq=1 – M. Becerra May 16 '17 at 21:02
  • bash fiddles with the process group for job control. https://unix.stackexchange.com/questions/363126/why-is-process-not-part-of-expected-process-group – thrig May 16 '17 at 21:17

1 Answers1

0

The sid (session id) should be consistent.

When bash runs a command, it generally assigns the PGID to the first process. If its a pipeline, all the piped commands have the same PGID as the first process.

marty
  • 52