rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Scott Merrilees <Sm@cerberus.bhpese.oz.au>
To: noel@es.su.oz.au
Cc: The rc Mailing List <rc@archone.tamu.edu>
Subject: Re: solaris 2.2 & rshd & rc
Date: Mon, 28 Mar 1994 22:13:28 -0500	[thread overview]
Message-ID: <199403290313.AA04481@cerberus.bhpese.oz.au> (raw)
In-Reply-To: Your message of "Mon, 28 Mar 94 21:54:26 EST." <199403291254.26792.out.bajem@es.su.oz.au>

    From:	Scott Merrilees <Sm@cerberus.bhpese.oz.au>
    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.

*** 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 */

      reply	other threads:[~1994-03-29  3:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-03-29  2:29 Scott Merrilees
1994-03-29  2:54 ` noel
1994-03-29  3:13   ` Scott Merrilees [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199403290313.AA04481@cerberus.bhpese.oz.au \
    --to=sm@cerberus.bhpese.oz.au \
    --cc=noel@es.su.oz.au \
    --cc=rc@archone.tamu.edu \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).