in reply to Re: Net::OpenSSH and fork()
in thread Net::OpenSSH and fork()
Thanks all for the help and suggestions!
Net::OpenSSH::Parallel looked promising. But at the time I started the project, the CPAN documentation had a note that it was still an alpha version. So I did not install it.
My example used the fork() function, but I actually use forks.pm. I like the Perl threads feature, but my binary is not complied with support for it. Among other things, I need to run other tasks in parallel besides just SSH commands, and I also need to do some IPC between the processes. The Perl threads feature is a lot easier to use for IPC than pipes and other pure-UNIX solutions.
I just downloaded version 0.48 of the module and modified the DESTROY method, from
if ($pid) {
to
if ($pid && $perl_pid == $$) {
This solves the problem.
Best Regards,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Net::OpenSSH and fork()
by salva (Canon) on Aug 07, 2010 at 08:07 UTC | |
by scotchie (Novice) on Aug 17, 2010 at 17:16 UTC |