From 1daa20faddc6f1e57b8a3b142c4c5f90b89eba6a Mon Sep 17 00:00:00 2001 From: "hadaq@countinghouse" Date: Fri, 25 Apr 2014 22:06:26 +0200 Subject: [PATCH] kill ioc when IOCs should be restarted, mt --- evtbuild/start_eb_gbe.pl | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/evtbuild/start_eb_gbe.pl b/evtbuild/start_eb_gbe.pl index cf0bcaa..232c0fb 100755 --- a/evtbuild/start_eb_gbe.pl +++ b/evtbuild/start_eb_gbe.pl @@ -960,10 +960,40 @@ sub killIOC() } } + + + #- Wait for children foreach my $cur_child_pid (@process_list) { waitpid($cur_child_pid,0); } + + ### just kill the remaining stuff + @process_list = (); + + foreach my $ip (@EB_IP_list){ + my $cmd = qq|ssh scs\@$ip "/usr/bin/pkill -f \\"SCREEN -dmS ioc_eb\\""|; + print $cmd; + &forkMe($cmd, "/tmp/ioc_kill_$ip", \@process_list); + } + + foreach my $cur_child_pid (@process_list) { + waitpid($cur_child_pid,0); + } + + sleep 1; + + ### just kill the remaining stuff + @process_list = (); + foreach my $ip (@EB_IP_list){ + my $cmd = qq|ssh scs\@$ip "/usr/bin/pkill -9 -f \\"SCREEN -dmS ioc_eb\\""|; + &forkMe($cmd, "/tmp/ioc_kill2_$ip", \@process_list); + } + + foreach my $cur_child_pid (@process_list) { + waitpid($cur_child_pid,0); + } + } sub forkMe() @@ -976,7 +1006,7 @@ sub forkMe() push( @$proc_list, $child ); } elsif( $child == 0 ) { # child - system("$cmd > $log"); + system("$cmd >$log 2>&1 "); exit(0); } else{ -- 2.43.0