From: hadaq@countinghouse Date: Fri, 25 Apr 2014 20:06:26 +0000 (+0200) Subject: kill ioc when IOCs should be restarted, mt X-Git-Tag: pre2018~83 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=1daa20faddc6f1e57b8a3b142c4c5f90b89eba6a;p=hadesdaq.git kill ioc when IOCs should be restarted, mt --- 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{