smk@axiom.UUCP (Steven M. Kramer) (10/24/85)
When inews forks to be nice and not make the user waits, the parent goes away. The problem is that in 4.2BSD, exit() for the parent makes the child an orphan (that's OK) but resets the process group to -1. The child no longer has the process group of the terminal now! To make matters worse, the csh (if you're using it) resets the terminal process group, so you can't even do a setpgrp(0, <old parent pid>) from the orphan. If an error occurs and stderr is used, the child dies, most likely leaving LOCK files and uncompleted business. About the only thing to do is to ingore the SIGTTOU you would get. This fixes the problem here and let the error messages pass through to the terminal. The relevant code is in a #ifdef AXIOM below. It's after the first fork() in inews.c -------------------------------------- inews.c code portion -------------------------------------- /* Determine input. */ if (mode != PROC) input(); #ifndef VMS /* Go into the background so the user can get on with his business. */ if (mode != PROC) { i = fork(); if (i != 0) exit(0); } #endif VMS #ifdef AXIOM #ifdef SIGTTOU /* Let error messages pass and not kill the process. smk@axiom */ signal(SIGTTOU, SIG_IGN); #endif #endif /* Do the actual insertion. */ insert(); } /* * Create directory named by bfr. * Don't if user doesn't want to. */ ngcheck(ngname) char *ngname; -- --steve kramer {allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!axiom!smk (UUCP) linus!axiom!smk@mitre-bedford (MIL)