Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Threads Printing Issue - Output Mangled / Term Crashing

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


in reply to Re^2: Threads Printing Issue - Output Mangled / Term Crashing
in thread Threads Printing Issue - Output Mangled / Term Crashing

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)

Replies are listed 'Best First'.
Re^4: Threads Printing Issue - Output Mangled / Term Crashing
by bigbot (Beadle) on Apr 14, 2014 at 12:21 UTC
    But do you think the SSH -t options are what's causing the issue?
      I don't see any error on your code so I blame the unknown! :-)

      Now seriously, yes, the TTY handling code in OpenSSH is quite hairy and bugs there are not so uncommon as one would like.

        OK great suggestion I should have thought of this sooner. It was the only option I changed in the SSH line and that was most likely causing the issue. I just find it weird that simply putting that output in a variable can mess up your local prompt.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1082240]
help
Chatterbox?
[GotToBTru]: i am satisfied with the default settings turning the seemingly random formatting into something reliable
[Corion]: GotToBTru: Yeah, I started a quick(ly implemented but slowly running) implementation of a program that would guess the "best" configuration (that is, least amount of changes) from my code, but then found that it stops parsing the source as soon as it ..
[GotToBTru]: sadly, it can't do anything about this
[Corion]: ... encounters sub foo($bar,$baz) {, which is something I like nowadays
[Corion]: GotToBTru: Yeah, that stuff is hard to do away automatically ;)
[GotToBTru]: yeah, you mentioned it could not handle signatures
[Corion]: And so far I like signatures and nobody has yet come up to me and screamed at me for implementing a source filter to handle them even on early Perl versions ;)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-02-27 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (387 votes). Check out past polls.