From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from archone.tamu.edu ([128.194.53.42]) by hawkwind.utcs.toronto.edu with SMTP id <24189>; Mon, 28 Mar 1994 22:15:05 -0500 Received: from merlin.resmel.bhp.com.au ([134.18.1.6]) by archone.tamu.edu with SMTP id <11416>; Mon, 28 Mar 1994 21:13:47 -0600 Received: from cerberus.bhpese.oz.au by merlin.resmel.bhp.com.au with SMTP id AA19648 (5.67b/IDA-1.5 for ); Tue, 29 Mar 1994 13:13:29 +1000 Received: from localhost by cerberus.bhpese.oz.au with SMTP id AA04481; Tue, 29 Mar 1994 13:13:31 +1000; sendmail 5.67a/Sm3.12RMPSU (from Sm@cerberus.bhpese.oz.au for rc@archone.tamu.edu) Message-Id: <199403290313.AA04481@cerberus.bhpese.oz.au> To: noel@es.su.oz.au Cc: The rc Mailing List Subject: Re: solaris 2.2 & rshd & rc In-Reply-To: Your message of "Mon, 28 Mar 94 21:54:26 EST." <199403291254.26792.out.bajem@es.su.oz.au> X-Face: '82~l%BnDBWVn])DV^cl_%bla$T]kNbRN&]>v{ED9[" From: Scott Merrilees When doing a rsh command to a solaris 2.2 box, I find that the rc started by rshd hangs in a cpu loop after the command has terminated. Interestingly, SIGCLD is ingored in both rshd & rc. Has anyone else fixed this problem ? >From: noel@es.su.oz.au >it's not that rc _ignores_ SIGCLD, it just doesn't touch it. when rc >is started by login and forks a program, you will notice that SIGCLD >is SIG_DFL. but when rc is started by rshd, it must be set to SIG_IGN. >bad shit happens in sysvr4 when this is done, namely, a parent is not >notified of the death of a child, so rc just sits in that wait loop >waiting to pick up the status of the child it just forked, a status >it will never get. i noticed the cpu in a tight loop when this happened. > >anyway, i just hacked the code to make sure SIGCLD is _always_ SIG_DFL. >this seems to fix the problem. That was my guess, I figure that rshd must be doing a process id specific wait, such as waitpid(), and doesn't want to get hit with SIGCLD signals. After looking in fn.c:setsigdefaults(), I came up with the following patch to fn.c:inithandlers(). This seems to work. The patch is relative to rc-1.4. Sm -- *** fn.c.orig Tue Mar 29 12:37:04 1994 --- fn.c Tue Mar 29 12:39:16 1994 *************** *** 45,50 **** --- 45,54 ---- fnrm("sigterm"); /* ditto for SIGTERM */ } } + #ifdef NOSIGCLD + rc_signal(SIGCLD, SIG_DFL); + delete_fn(signals[SIGCLD].name); + #endif } /* only run this in a child process! resets signals to their default values */