Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Net::OpenSSH across fork & exec

by salva (Canon)
on Mar 15, 2011 at 16:56 UTC ( [id://893377]=note: print w/replies, xml ) Need Help??


in reply to Net::OpenSSH across fork & exec

I have added the feature to reuse an external OpenSSH master connection to the latest development version (1.51_05):
my $ssh = Net::OpenSSH->new($host, reuse_master => 1, ctl_path => $from_first_script);

Though, I don't really like calling the new option "reuse_master", I am thinking of changing it to "external_master".

Replies are listed 'Best First'.
Re^2: Net::OpenSSH across fork & exec
by dwalin (Monk) on Mar 15, 2011 at 20:21 UTC
    Thanks for such quick reply. I have removed my previous suggestion, since it appears that you have already did that. :)

    Regards,
    Alex.

      yes, now, it works as follows:
      #!perl -w use Net::OpenSSH; my $ssh = Net::OpenSSH->new("hostname"); if (my $pid = fork) { # wait for children, do something } elsif ($pid == 0) { exec "another_perl_script", $ssh->get_ctl_path; } __END__ another_perl_script: #!perl -w use Net::OpenSSH; my $ssh = Net::OpenSSH->new($host_or_some_dummy_value, ctl_path => $ARGV[0], reuse_master => 1); $ssh->system("remote command");
Re^2: Net::OpenSSH across fork & exec
by bibliophile (Prior) on Mar 16, 2011 at 15:17 UTC
    FOSS for the win!
    salva++

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://893377]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-25 08:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found