Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Threads Printing Issue - Output Mangled / Term Crashing

by salva (Abbot)
on Apr 14, 2014 at 11:41 UTC ( #1082232=note: print w/replies, xml ) Need Help??

in reply to Threads Printing Issue - Output Mangled / Term Crashing

Probably the error is related to having several ssh processes accessing /dev/tty in parallel.

In any case, you can try using Net::OpenSSH::Parallel.

Replies are listed 'Best First'.
Re^2: Threads Printing Issue - Output Mangled / Term Crashing
by bigbot (Beadle) on Apr 14, 2014 at 11:46 UTC
    Well I have a lot of other scripts that create many simultaneous SSH connections at once (with no issues like this, even printing out data, etc). However, this is the first time I've had to use the SSH -tt option to force Force pseudo-tty allocation on the remote systems. This is because tcpdump doesn't die after the SSH connection is closed without it (at least until it sees a packet that matches the filter).
      Then, and easy workaround is to write a wrapper for tcpdump that launches it and then kills it when stdin is closed:
      #!/usr/bin/perl # untested: require POSIX; my $pid = fork; unless ($pid) { exec 'tcpdump', @ARGV; POSIX::_exit(1); } while (<>) { ; }; # just discard input until EOF kill KILL => $pid;
      You will have to place the wrapper on the remote machines (or just make it into a perl one-liner and pass it on the ssh call)
        But do you think the SSH -t options are what's causing the issue?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082232]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2018-02-19 14:37 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (265 votes). Check out past polls.