andrikoz / parallel-ssh

Automatically exported from code.google.com/p/parallel-ssh
Other
0 stars 0 forks source link

pssh ignores stderr #46

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
pssh collects stdout (with --print option) and ignores stderr, whereas stderr 
is the important thing: all errors are printed there.

Original issue reported on code.google.com by stepan.k...@gmail.com on 5 Mar 2011 at 9:08

GoogleCodeExporter commented 8 years ago
If you use the -i option ("inline"), both stdout and stderr are collected.  
Also, the -e option can be used to write stderr to files.  Since I don't 
personally use the -P option, I don't have a strong opinion on whether it 
should include stderr in addition to stdout.  It would be nice to get feedback 
from some more people that use -P.  I'm just a bit nervous about breaking 
things for other users.

Original comment by amcna...@gmail.com on 6 Mar 2011 at 8:06

GoogleCodeExporter commented 8 years ago
Thank you.

Original comment by stepan.k...@gmail.com on 6 Mar 2011 at 8:25

GoogleCodeExporter commented 8 years ago
What do you think?  Is the -i option enough, or would it be best if -P included 
both stdout and stderr?  Feel free to start a discussion on the mailing list if 
you think this should be changed.

And thank you very much for your interest and participation with pssh.

Original comment by amcna...@gmail.com on 6 Mar 2011 at 10:43

GoogleCodeExporter commented 8 years ago
Actually, I don't understand what --include flag does (explanation in --help or 
in wiki could help). But flag works, and I just use it now.

I'm pretty sure that stdout and stderr should be either both shown or both 
hidden. If you insist that -P behavior is correct, please at least replace 
"output" with "stdout" word in --help output.

And I also think that that "Stderr: " prefix before stderr output is not 
necessary. Bash or plain ssh do not output this prefix. If program running on 
the server wants to tell something important, it just adds loud marker itself.

And again, thank you very much for pssh, it saved me a lot of time.

Original comment by stepan.k...@gmail.com on 6 Mar 2011 at 11:01

GoogleCodeExporter commented 8 years ago
-i waits until command completes, I got it. Now I want -P to contain stderr 
again :)

Original comment by stepan.k...@gmail.com on 6 Mar 2011 at 11:21

GoogleCodeExporter commented 8 years ago
When you mentioned "--include", that was a typo for "--inline", right?

Anyway, I don't have strong feelings about whether -P does stderr as well as 
stdout.  I'd be inclined to agree that it would be reasonable for it to do 
both, but as it's a change, I would want to be confident that it wouldn't 
negatively affect other users of the option.  I wouldn't be surprised if 
everyone loves the idea, but I also wouldn't be surprised if someone came up 
with a reason for the current behavior.  Would you mind bringing this up on the 
mailing list to see what everyone thinks?

Original comment by amcna...@gmail.com on 7 Mar 2011 at 4:59

GoogleCodeExporter commented 8 years ago
So, I've never been too happy with the --print option because of the way that 
it haphazardly interleaves output. I realized today that I think it can be 
redeemed if each line of the output were preceded by the host name. This would 
have to be a separate option. I think I would make two new options: 
--print-stdout and --print-stderr. Here's an example:

$ pssh -H localhost --print-stderr ls /abc /root
stderr (localhost): ls: cannot access /abc: No such file or directory
stderr (localhost): ls: cannot open directory /root: Permission denied
[1] 12:41:29 [FAILURE] localhost Exited with error code 2
$

1) Would this do everything that you need?

2) Any thoughts on how the prefix should be formatted?

3) Any thoughts about how to deal with partial lines? A line of output might be 
split into two pieces if it doesn't all arrive at the same time.

Original comment by amcna...@gmail.com on 23 Jan 2012 at 7:47