9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] rx - wot no stderr?
@ 2007-01-17 17:14 Steve Simon
  2007-01-19 12:32 ` Gorka guardiola
  0 siblings, 1 reply; 9+ messages in thread
From: Steve Simon @ 2007-01-17 17:14 UTC (permalink / raw)
  To: 9fans

I was surprised to find plan9's implementaion of
rx(1) and rexexec(8) don't support a seperate socket
for stderr out of the remote application.

I can see that it is not that great, but somtimes
when doing (from the manpage):

	eqn paper | rx kremvax troff -ms | rx deepthought lp

It would be nice to see your troff error messages
onscreen rather than having to collect them from the
printer.

Was the decision not to implement stderr strongly
felt, or just a case of "Its not worth the complexity"?

-Steve


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

* Re: [9fans] rx - wot no stderr?
  2007-01-17 17:14 [9fans] rx - wot no stderr? Steve Simon
@ 2007-01-19 12:32 ` Gorka guardiola
  2007-01-19 13:07   ` erik quanstrom
  2007-01-21  7:06   ` ron minnich
  0 siblings, 2 replies; 9+ messages in thread
From: Gorka guardiola @ 2007-01-19 12:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 1/17/07, Steve Simon <steve@quintile.net> wrote:
> I was surprised to find plan9's implementaion of
> rx(1) and rexexec(8) don't support a seperate socket
> for stderr out of the remote application.
>
> I can see that it is not that great, but somtimes
> when doing (from the manpage):
>
>         eqn paper | rx kremvax troff -ms | rx deepthought lp
>
> It would be nice to see your troff error messages
> onscreen rather than having to collect them from the
> printer.

I always survived this redirecting error messages to a file in
the remote command. ¿Isn't that enough?.
-- 
- curiosity sKilled the cat


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

* Re: [9fans] rx - wot no stderr?
  2007-01-19 12:32 ` Gorka guardiola
@ 2007-01-19 13:07   ` erik quanstrom
  2007-01-19 14:35     ` Steve Simon
  2007-01-21  7:06   ` ron minnich
  1 sibling, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2007-01-19 13:07 UTC (permalink / raw)
  To: 9fans

rexexec(8) doesn't have anything to do with supporting stderr.
listen does this work.  (assuming a p9 system not using ssh to connect.)
/sys/src/cmd/aux/listen.c:/^newcall dup(2)'s all three descriptors from 
the incoming call.  since it's a single Channel in the kernel, there's no way 
to differentiate writes on fd 0, 1 or 2.  if you want that, you need
to mux and demux the filedescriptors onto some protocol.

- erik

On Fri Jan 19 07:35:20 EST 2007, paurea@gmail.com wrote:
> On 1/17/07, Steve Simon <steve@quintile.net> wrote:
> > I was surprised to find plan9's implementaion of
> > rx(1) and rexexec(8) don't support a seperate socket
> > for stderr out of the remote application.
> >
> > I can see that it is not that great, but somtimes
> > when doing (from the manpage):
> >
> >         eqn paper | rx kremvax troff -ms | rx deepthought lp
> >
> > It would be nice to see your troff error messages
> > onscreen rather than having to collect them from the
> > printer.
> 
> I always survived this redirecting error messages to a file in
> the remote command. ¿Isn't that enough?.
> -- 
> - curiosity sKilled the cat


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

* Re: [9fans] rx - wot no stderr?
  2007-01-19 13:07   ` erik quanstrom
@ 2007-01-19 14:35     ` Steve Simon
  2007-01-19 22:17       ` erik quanstrom
  0 siblings, 1 reply; 9+ messages in thread
From: Steve Simon @ 2007-01-19 14:35 UTC (permalink / raw)
  To: 9fans

> rexexec(8) doesn't have anything to do with supporting stderr.
> listen does this work.  (assuming a p9 system not using ssh to connect.)
> /sys/src/cmd/aux/listen.c:/^newcall dup(2)'s all three descriptors from
> the incoming call.  since it's a single Channel in the kernel, there's no way
> to differentiate writes on fd 0, 1 or 2.  if you want that, you need
> to mux and demux the filedescriptors onto some protocol.

Agreed, however the old BSD rexec protocol has hooks for a seccond
socket connection called back from the server to support stderr.
It is an optional enhancement and though plan9's rx(1) does support BSD
compatibility, doesn't support this feature; and yes it would open the
same old wounds that ftp's passive mode was designed to heal :-)

My question (perhaps badly phrased) was more about the decision not to
support stderr, why was it done? In a pure plan9 enviroment we already have
a protocol to mux and demux file descriptors as demonstarted in cpu(1).

On a similar topic a file like /dev/cpunote could forwarward notes to
the remote process to ensure it dies when told to rather than assuming
it will see an EOF on its input one day.

Was it just too much hassle for too little reward or am I missing someting,
is there a good reason why this just cannot work.

-Steve


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

* Re: [9fans] rx - wot no stderr?
  2007-01-19 14:35     ` Steve Simon
@ 2007-01-19 22:17       ` erik quanstrom
  2007-01-20  1:15         ` Steve Simon
  0 siblings, 1 reply; 9+ messages in thread
From: erik quanstrom @ 2007-01-19 22:17 UTC (permalink / raw)
  To: 9fans

if you are talking to a plan 9 server, stderr already works:

	; cpu -c echo fu
	fu
	; cpu -c echo fu '>[1=2]' >/dev/null
	fu

On Fri Jan 19 09:39:07 EST 2007, steve@quintile.net wrote:
> My question (perhaps badly phrased) was more about the decision not to
> support stderr, why was it done? In a pure plan9 enviroment we already have
> a protocol to mux and demux file descriptors as demonstarted in cpu(1).
>
> On a similar topic a file like /dev/cpunote could forwarward notes to
> the remote process to ensure it dies when told to rather than assuming
> it will see an EOF on its input one day.
>
> Was it just too much hassle for too little reward or am I missing someting,
> is there a good reason why this just cannot work.
>
> -Steve


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

* Re: [9fans] rx - wot no stderr?
  2007-01-19 22:17       ` erik quanstrom
@ 2007-01-20  1:15         ` Steve Simon
  2007-01-20  1:34           ` erik quanstrom
  2007-01-24 21:03           ` rog
  0 siblings, 2 replies; 9+ messages in thread
From: Steve Simon @ 2007-01-20  1:15 UTC (permalink / raw)
  To: 9fans

> if you are talking to a plan 9 server, stderr already works:

I don'r believe it does in the way I mean. The server-side of cpu opens
/mnt/term/dec/cons for stdout and again for stderr so you cannot run a remote
program, and locally redirect its stdout and stderr (without using a
temporary file in a shared file space for one or t'other as already mentioned.

>From my earlier example

	eqn paper | cpu kremvax -c troff -ms >[2] errfile | cpu -c deepthought lp

will not put my troff errors in errfile, though I admit
this is becomming a rather contrived example.

I would like to be able to do:

	rx -l steve host program > prog.out >[2] prog.err

and I cannot.

I thought about using cpu and putting a local filesystem MBEFORE
/dev/cons but it would have to make assumptions about the order
in which the remote cpu server opened /dev/cons (stdout and stderr)
which is a bit wooly for my liking.

Its not a big deal, I just wondered if there was a reason,
and I guess the answer is, no, no big reason, just no one
wanted it enough to do the work.

-Steve


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

* Re: [9fans] rx - wot no stderr?
  2007-01-20  1:15         ` Steve Simon
@ 2007-01-20  1:34           ` erik quanstrom
  2007-01-24 21:03           ` rog
  1 sibling, 0 replies; 9+ messages in thread
From: erik quanstrom @ 2007-01-20  1:34 UTC (permalink / raw)
  To: 9fans

On Fri Jan 19 20:17:18 EST 2007, steve@quintile.net wrote:
> > if you are talking to a plan 9 server, stderr already works:
>
> I don'r believe it does in the way I mean. The server-side of cpu opens
> /mnt/term/dec/cons for stdout and again for stderr so you cannot run a remote
> program, and locally redirect its stdout and stderr (without using a
> temporary file in a shared file space for one or t'other as already mentioned.
>

you're right.  my example is flawed.  here's a better illustration of what's going
on:

	cpu% cpu -c echo fu '>[1=2]' ';' echo bar >[2=]
	fu
	bar

- erik


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

* Re: [9fans] rx - wot no stderr?
  2007-01-19 12:32 ` Gorka guardiola
  2007-01-19 13:07   ` erik quanstrom
@ 2007-01-21  7:06   ` ron minnich
  1 sibling, 0 replies; 9+ messages in thread
From: ron minnich @ 2007-01-21  7:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 1/19/07, Gorka guardiola <paurea@gmail.com> wrote:
> I always survived this redirecting error messages to a file in
> the remote command. ¿Isn't that enough?.

sadly, no. At least for what we do. We need that stderr, we need it on
the 'local' side, note the 'remote' side, we need to be able to
seperate it out from stdout, and lots of things don't provide that,
not just rexec and cpu ...

Xcpu now does, at the request of our users.

Also, opening a second socket for stderr is really a bad idea for
n>=1024. 9p knows how to mux, so we use that nice fact.

Both rexec and cpu could make slightly more use of 9p to seperate the
two streams, I have always though. But it would take some work.

ron


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

* Re: [9fans] rx - wot no stderr?
  2007-01-20  1:15         ` Steve Simon
  2007-01-20  1:34           ` erik quanstrom
@ 2007-01-24 21:03           ` rog
  1 sibling, 0 replies; 9+ messages in thread
From: rog @ 2007-01-24 21:03 UTC (permalink / raw)
  To: 9fans

> I would like to be able to do:
>
> 	rx -l steve host program > prog.out >[2] prog.err
>
> and I cannot.

you can do:

	echo hello | cpu -h host -c 'wc < /mnt/term/fd/10 > /mnt/term/fd/11 >[2] /mnt/term/fd/12' <[10=0] >[11=1] >[12=2] | tr '0-9' x

you'll get the 9p ping-pong penalty, but at least it can be done.

you could run the operative part up as a script if you felt like it.
unfortunately cpu doesn't do proper argument quoting, so you run
the risk of getting unexpected results if you try to get clever.



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

end of thread, other threads:[~2007-01-24 21:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-17 17:14 [9fans] rx - wot no stderr? Steve Simon
2007-01-19 12:32 ` Gorka guardiola
2007-01-19 13:07   ` erik quanstrom
2007-01-19 14:35     ` Steve Simon
2007-01-19 22:17       ` erik quanstrom
2007-01-20  1:15         ` Steve Simon
2007-01-20  1:34           ` erik quanstrom
2007-01-24 21:03           ` rog
2007-01-21  7:06   ` ron minnich

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