On Thu, Apr 24, 2014 at 11:23:41AM -0400, sven falempin wrote: > Dear OpenBSD misc reader, > > I am a bit lost in all the manpages related to process id and parent and > group .... > reading the fork manpage, I do not read the child group id is set. > > Is it a good practice to set the group id to the parent process id, > thus allowing a 'kill -ppid' command to kill all forked process. > > Best regards,
The process group id of a child after fork is the same as the process group id of its parent. Since fork(2) does not list the process group id as an exception, it follows it's a copy of the parent, as stated in the first paragraph. If you want to implement shell-like functions, a setpgrp call might be usefull, but not in general. This article gives some background info: http://www.informit.com/articles/article.aspx?p=366888&seqNum=8 -Otto

