From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from odin.INS.CWRU.Edu ([129.22.8.102]) by archone.tamu.edu with SMTP id <19095>; Wed, 2 Oct 1991 14:56:33 -0500 Received: by odin.INS.CWRU.Edu (5.65b+ida+/CWRU-1.4-ins) id AA25687; Wed, 2 Oct 91 15:55:51 -0400 (from chet for rc@archone.tamu.edu) Date: Wed, 2 Oct 1991 14:53:02 -0500 From: Chet Ramey To: schwartz@cs.psu.edu Subject: Re: descriptor 6 Cc: rc@archone.tamu.edu Reply-To: chet@po.CWRU.Edu In-Reply-To: Message from schwartz@cs.psu.edu of Wed, 2 Oct 1991 13:51:35 -0500 Message-Id: <9110021953.AA25673.SM@odin.INS.CWRU.Edu> Read-Receipt-To: chet@po.CWRU.Edu > When I do this > > rsh roke -n 'sleep 100 >/dev/null >[2=1] &' > > the rsh doesn't return immediately, as I would have expected. > It looks like file descriptor 6 is open on the other end, > preventing rshd from exiting. Is this an rc-ism? Is there a > preferred idiom for closing all unwanted descriptors? This is a bug in rshd, fixed in 4.3-reno but present in all earlier versions. Here's an excerpt from a message I sent to a few people describing the bug: rshd sets up a pipe (int pv[2]; if you have the source to the tahoe rshd) to the process it executes and uses it to manage error and control output from over the net. In the child process, it does a dup2(pv[1], 2), but never calls close(pv[1]). Adding that code to the 4.3-tahoe rshd makes it (and the Xemacs script) work right. -- ``Teach them politics and war so their sons may study medicine and mathematics in order to give their children a right to study painting, poetry, music, and architecture.'' Chet Ramey, CWRU Inet: chet@po.CWRU.Edu NeXT Mail: chet@macbeth.INS.CWRU.Edu