Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!qantel!lll-lcc!lll-crg!seismo!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: net.unix-wizards Subject: Re: rlogind / BRL Sys V problem Message-ID: <337@brl-smoke.ARPA> Date: Mon, 28-Apr-86 00:27:27 EDT Article-I.D.: brl-smok.337 Posted: Mon Apr 28 00:27:27 1986 Date-Received: Fri, 2-May-86 22:42:51 EDT References: <5530@root44.UUCP> Reply-To: gwyn@brl.ARPA Organization: Ballistic Research Lab (BRL) Lines: 65 In article <5530@root44.UUCP> aegl@root44.UUCP (Tony Luck) writes: >/etc/rlogind ignores SIGCHLD before invoking /bin/login - thus all child >processes inherit this. The wait(2) library code in Doug's package checks >to see if you are ignoring SIGCHLD, if you are it waits for all children >and returns -1 with errno=ECHILD. > >1) Why does /etc/rlogind leave SIGCHLD in SIG_IGN state when execl'ing > /bin/login - this appears to be a simple oversight - but too many users > here will want to break my arms if I just change it and then discover a > good reason for this behaivour later! It's a bug. SIGCHLD should be set to SIG_DFL to ignore it, not to SIG_IGN. (Yes, I am serious!) I think we found all these and stamped them out in the BRL edition of 4.2BSD. >2) Why does the "wait()" code check for SIGCHLD and then wait for all children >to die - this might be to try to emulate the "if a process ignores SIGCLD >then it's children won't turn into zombies when they die" mode of system V >(I thought you needed garlic+holy water for that!) The emulation does this because the System V documentation says so. I personally think it's a crock and wouldn't object if you modify your copy of the emulation to disable this feature. I see that the feature is not mentioned in the latest SVID, so portable code should not depend on it anyway. If you don't have source, here's the module in question (compile it under the System V environment): /* wait -- system call emulation for 4.2BSD or BRL PDP-11 UNIX last edit: 18-Sep-1983 D A Gwyn */ #include #include extern int _wait(); int wait( stat_loc ) int *stat_loc; /* where to put status */ { register void (*sig)(); /* entry SIGCLD state */ if ( (sig = signal( SIGCLD, SIG_IGN )) == SIG_IGN ) { while ( _wait( stat_loc ) != -1 || errno != ECHILD ) ; /* wait for all children */ return -1; /* ECHILD */ } else { (void)signal( SIGCLD, sig ); /* restore entry state */ return _wait( stat_loc ); } } >... Apart from a few oddities with ioctls that can't be mapped right ... I'm considering adjusting the terminal ioctl emulation to use CBREAK under suitable circumstances. Another possibility is to try to do something more intelligent with the MIN, TIME fields. There are certain mode combinations that can't be emulated correctly, since the Berkeley terminal driver doesn't have adequate orthogonality. Of course, the best solution would be to have the kernel provide an entire AT&T-style terminal handler as a separate line discipline.