jamesgerard1964 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use Parallel::ForkManager to run an external script to about 200 servers. I am currently running on a Linux server running RH. The external script is kicked off via an ssh command. The server hangs just about everyday and has to be rebooted to recover. Can someone tell me if the external command should be kicked off with 'system', 'exec', or 'backticks'. I don't need to wait on any output from the script. Currently I'm using the backticks.
my $pm = Parallel::ForkManager->new( 10 ); $SIG{ALRM} = sub { die ("TimeOut"); }; eval { alarm( 300 ); foreach my $server (@servers) { my $pid = $pm->start and next; my $fqdn = "$server.$domain"; my $status = `ssh -o UserKnownHostsFile=/dev/null -o StrictH +ostKeyChecking=no $id\@$fqdn cat <$script \"|\" 2>/dev/null $int - -- +fromhost $whoami`; sleep 4; $pm->finish; } $pm->wait_all_children(); alarm(0); }; # end of eval
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parallel::ForkManager and possible memory leak
by salva (Canon) on Feb 17, 2015 at 16:27 UTC | |
|
Re: Parallel::ForkManager and possible memory leak
by bitingduck (Deacon) on Feb 17, 2015 at 16:41 UTC | |
by jamesgerard1964 (Novice) on Feb 17, 2015 at 17:13 UTC | |
|
Re: Parallel::ForkManager and possible memory leak
by stonecolddevin (Parson) on Feb 17, 2015 at 17:20 UTC |