rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* descriptor 6
@ 1991-10-02 18:51 Scott Schwartz
  1991-10-09 21:24 ` Chris Siebenmann
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Schwartz @ 1991-10-02 18:51 UTC (permalink / raw)
  To: rc


Hi all,


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?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: descriptor 6
  1991-10-02 18:51 descriptor 6 Scott Schwartz
@ 1991-10-09 21:24 ` Chris Siebenmann
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Siebenmann @ 1991-10-09 21:24 UTC (permalink / raw)
  To: rc

 Various versions of rsh on various systems (probably with various
options, too) leave all sorts of file descriptors open. The best
way I've found of dealing with this so far is to figure out which
descriptors are being left open and then close them manually.
I suppose there's a great future for a 'clean' command that fixes
this sort of thing.

	- cks


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: descriptor 6
@ 1991-10-02 19:53 Chet Ramey
  0 siblings, 0 replies; 3+ messages in thread
From: Chet Ramey @ 1991-10-02 19:53 UTC (permalink / raw)
  To: schwartz; +Cc: rc

> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1991-10-09 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-10-02 18:51 descriptor 6 Scott Schwartz
1991-10-09 21:24 ` Chris Siebenmann
1991-10-02 19:53 Chet Ramey

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).