in reply to Re^5: Net::SSH2 exec timeout
in thread Net::SSH2 exec timeout

Yeah, does seem like that. Trying to redefine $ssh inside the thread yeilds:
Attempt to free non-existent shared string 'GEN0', Perl interpreter: 0 +x8990e48 at Configuration.pl line 41, <> line 3. Segmentation fault


If I try to completely make up a whole new connection like so:
async { my $ssh2 = Net::SSH2->new(); $ssh2->connect($host); $ssh2->auth_password($user,$password); print "Upgrading firmware, this will take about 3 minutes. +\n"; my $chan2 = $ssh2->channel(); $chan2->exec("/sbin/fwupdate -m\n"); $chan2->close; }->detach;

I get this error:
Attempt to free non-existent shared string 'GEN0', Perl interpreter: 0 +x83f4e98, <> line 3. Unbalanced string table refcount: (1) for "GEN0" during global destruc +tion. Unbalanced string table refcount: (1) for "/usr/share/perl/5.12/Symbol +.pm" during global destruction. Scalars leaked: -6


This error is not fatal though but it apparently does not pass beyond this and my script hangs.

Replies are listed 'Best First'.
Re^7: Net::SSH2 exec timeout
by BrowserUk (Patriarch) on Sep 09, 2011 at 01:21 UTC

    It looks like forking or shelling out are your best options.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      fork /yes, I know it's an old joke.