Intel RedHat 6.0, kernel 2.2.12-10 If I run the following program it creates 240 child processes and then hangs. If I do ps -ef I get 240 entries like this: je 5562 5470 0 15:52 pts/1 00:00:00 [a.out <defunct>] It looks like the children aren't being cleared up properly when they die. John Eastmond --------------------------- #include <stdio.h> #include <unistd.h> int main(int argc, char *argv[]) { int i,ch_pid; for (i=0; i<1000; i++) { if (!(ch_pid=fork())) break; sleep(1); } if (!ch_pid) { int pid=getpid(); printf("child: %d pid: %d\n",i,pid); exit(0); } else { int pid=getpid(); printf("parent: %d\n",pid); exit(0); } }
You need to wait() for the child process in the parent.
Commit pushed to master at https://github.com/openshift/openshift-docs https://github.com/openshift/openshift-docs/commit/1626634fc9681d134633b1a30624048fc67b1bbf Merge pull request #7442 from tmorriso-rh/Issue-6022-broken-links-for-CNS Issue 6022: Fixed broken links to CNS for OCP content