Thu Sep 20 00:02:42 CEST 2012


More a unix thing, but a very interesting article nontheless.  This
caught my attention:

  By default, fork(2) places a newly created child process in the same
  process group as its parent, so that e.g. a ^C from the keyboard
  will affect both parent and child. But the shell, as part of its
  session leader duties, creates a new process group every time it
  launches a pipeline.

I ran into trouble recently trying to start a bunch of processes from
a shell, but being surprised why they did not end up in one process
group.  The explanation makes perfect sense: a process group is best
associated to a single pipeline.  What I did was an "implicit"
pipeline: some processes work together sharing named pipes or files &

Is there a different way to force this?  I.e. make the shell put
processes in a single group?

[1] http://www.linusakesson.net/programming/tty/