gurbo has asked for the wisdom of the Perl Monks concerning the following question:
This looks the same as Problem with threads in Net::SSH:Perl
The script:
The log:use Net::SSH::Perl; use threads; sub mydate { my $id = threads->tid(); my $ssh = new Net::SSH::Perl('127.0.0.1', protocol => '2', identit +y_files => ['fxfer.key'], debug => 1); $ssh->login('rob'); print "[$id] date\n"; my ($out, $err, $exit) = $ssh->cmd('date',"\n"); print "[$id] out: $out\n"; print "[$id] err: $err\n"; print "[$id] exit: $exit\n"; } for my $i (1..2) { print "*** #$i\n"; my $thr = new threads \&mydate; $thr->join(); print "\n"; }
*** #1 uqbar.arkham.com.ar: Reading configuration data /home/rob/.ssh/config uqbar.arkham.com.ar: Reading configuration data /etc/ssh_config uqbar.arkham.com.ar: Connecting to 127.0.0.1, port 22. uqbar.arkham.com.ar: Remote version string: SSH-2.0-OpenSSH_4.7p1 Debi +an-8ubuntu1.2 uqbar.arkham.com.ar: Remote protocol version 2.0, remote software vers +ion OpenSSH_4.7p1 Debian-8ubuntu1.2 uqbar.arkham.com.ar: Net::SSH::Perl Version 1.30, protocol version 2.0 +. uqbar.arkham.com.ar: No compat match: OpenSSH_4.7p1 Debian-8ubuntu1.2. uqbar.arkham.com.ar: Connection established. uqbar.arkham.com.ar: Sent key-exchange init (KEXINIT), wait response. uqbar.arkham.com.ar: Algorithms, c->s: 3des-cbc hmac-sha1 none uqbar.arkham.com.ar: Algorithms, s->c: 3des-cbc hmac-sha1 none uqbar.arkham.com.ar: Entering Diffie-Hellman Group 1 key exchange. uqbar.arkham.com.ar: Sent DH public key, waiting for reply. uqbar.arkham.com.ar: Received host key, type 'ssh-dss'. uqbar.arkham.com.ar: Host '127.0.0.1' is known and matches the host ke +y. uqbar.arkham.com.ar: Computing shared secret key. uqbar.arkham.com.ar: Verifying server signature. uqbar.arkham.com.ar: Waiting for NEWKEYS message. uqbar.arkham.com.ar: Enabling incoming encryption/MAC/compression. uqbar.arkham.com.ar: Send NEWKEYS, enable outgoing encryption/MAC/comp +ression. uqbar.arkham.com.ar: Sending request for user-authentication service. uqbar.arkham.com.ar: Service accepted: ssh-userauth. uqbar.arkham.com.ar: Trying empty user-authentication request. uqbar.arkham.com.ar: Authentication methods that can continue: publick +ey,password. uqbar.arkham.com.ar: Next method to try is publickey. uqbar.arkham.com.ar: Publickey: testing agent key '' uqbar.arkham.com.ar: Public key is accepted, signing data. uqbar.arkham.com.ar: Key fingerprint: 9e:3d:6b:65:f2:ca:89:bb:06:42:33 +:7e:d8:e4:75:af uqbar.arkham.com.ar: Login completed, opening dummy shell channel. uqbar.arkham.com.ar: channel 0: new [client-session] uqbar.arkham.com.ar: Requesting channel_open for channel 0. uqbar.arkham.com.ar: channel 0: open confirm rwindow 0 rmax 32768 uqbar.arkham.com.ar: Got channel open confirmation, requesting shell. uqbar.arkham.com.ar: Requesting service shell on channel 0. [1] date uqbar.arkham.com.ar: channel 1: new [client-session] uqbar.arkham.com.ar: Requesting channel_open for channel 1. uqbar.arkham.com.ar: Entering interactive session. uqbar.arkham.com.ar: Sending command: date uqbar.arkham.com.ar: Requesting service exec on channel 1. uqbar.arkham.com.ar: channel 1: send eof uqbar.arkham.com.ar: channel 1: open confirm rwindow 2097151 rmax 3276 +8 uqbar.arkham.com.ar: input_channel_request: rtype exit-status reply 0 uqbar.arkham.com.ar: channel 1: rcvd eof uqbar.arkham.com.ar: channel 1: output open -> drain uqbar.arkham.com.ar: channel 1: rcvd close uqbar.arkham.com.ar: channel 1: obuf empty uqbar.arkham.com.ar: channel 1: output drain -> closed uqbar.arkham.com.ar: channel 1: close_write uqbar.arkham.com.ar: channel 1: send close uqbar.arkham.com.ar: channel 1: full closed [1] out: Mon Nov 24 18:36:36 ARST 2008 [1] err: [1] exit: 0 *** #2 uqbar.arkham.com.ar: Reading configuration data /home/rob/.ssh/config uqbar.arkham.com.ar: Reading configuration data /etc/ssh_config uqbar.arkham.com.ar: Connecting to 127.0.0.1, port 22. uqbar.arkham.com.ar: Remote version string: SSH-2.0-OpenSSH_4.7p1 Debi +an-8ubuntu1.2 uqbar.arkham.com.ar: Remote protocol version 2.0, remote software vers +ion OpenSSH_4.7p1 Debian-8ubuntu1.2
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Net::SSH::Perl and threads
by McD (Chaplain) on Nov 24, 2008 at 22:23 UTC | |
|
Re: Problem with Net::SSH::Perl and threads
by salva (Canon) on Nov 25, 2008 at 09:12 UTC | |
|
Re: Problem with Net::SSH::Perl and threads
by zentara (Cardinal) on Nov 25, 2008 at 13:24 UTC |