--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868
Could you provide any more information about how to reproduce this? I
just did the following:
pssh -i -x "-t -t" -H localhost echo hi
but it didn't hang for me. Are there any other options that I should
add to reproduce the problem?
So, it looks like this first worked correctly, though ssh apparently got
a little confused about terminal settings or something.
> [user@host ~]$ echo 'echo foo' > bar.sh
> [user@host ~]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
>
> it will hang up, and after two ctrl-c (exact paste with PS1)
>
> [user@host _haras]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
> [1] 14:42:21 [FAILURE] 127.0.0.1 Interrupted
> Last login: Mon Aug 22 14:42:03 2011 from localhost
> [user@host ~]$ foo
> [user@host ~]$ Stderr: tcgetattr: Invalid argument
I think that the stuff from standard error is what made it hard to see
what was going on. If I trim this, it's a little easier to see what
happened:
[user@host _haras]$ pssh -x "-t -t" -H 127.0.0.1 -i -I < bar.sh
[1] 14:42:21 [FAILURE] 127.0.0.1 Interrupted
Last login: Mon Aug 22 14:42:03 2011 from localhost
[user@host ~]$ foo
[user@host ~]$
[user@host _haras]$
So, since ssh has a pseudo-terminal allocated (because of "-t -t"), it's
running an interactive shell instead of just running a single command.
The reason it's hanging is that the shell is asking for more input. :)
A quick and easy way to fix this is to add "exit" to the end of the
script.
However, I don't think that you really need a full pseudoterminal
allocated, so you might be better off just removing the "-t -t". I'm
not quite sure why ssh would be giving you warning messages about not
being to allocate a pseudo-terminal if you're not passing in "-t -t".
If this still seems to be a problem, could you share some more detail
about what's happening?
Just to make sure: this was the correct behavior this time, right?
The error occurs because it's forcing pseudoterminal allocation without
having a terminal. It's a legitimate error. I guess I'm still not
quite sure why the "-t -t" was needed in the first place.
Run a command without checking or saving host keys:
pssh -i -H host1 -H host2 -x "-O StrictHostKeyChecking=no -O UserKnownHostsFile=/dev/null -O GlobalKnownHostsFile=/dev/null" echo hi
On macos, however (and other BSDs, I would guess), the -O option sets up various multiplexing scenarios, just as the error suggests. Simply replacing the -Os with -o fixes the problem.
HTH