]> jspc29.x-matter.uni-frankfurt.de Git - hadesicinga.git/commitdiff
JAM: modified restart handler, still testing.
authorhadaq <hadaq>
Tue, 14 Feb 2012 15:39:40 +0000 (15:39 +0000)
committerhadaq <hadaq>
Tue, 14 Feb 2012 15:39:40 +0000 (15:39 +0000)
plugins/my_restart_handler.pl

index 02a2c375f65e72cf8e85d1b7e7fecad0f4fadf0b..7cd60a584d04fb1cc5d5f72d43ddb340a845c59e 100755 (executable)
@@ -80,21 +80,29 @@ sub main
 
            #--- is there anything to kill?
            if($out && $opt_k){
-               #--- kill
-               system("ssh -f $PC \"pidof -x $opt_s | xargs kill -9\" ");
+               #--- kill -f
+               print "my_restart_handler: killing...\n";
+               system("ssh  $PC \"pidof -x $opt_s | xargs kill -9\" ");
+         
            }
            elsif($out && $opt_r){
                #--- kill and restart
-               system("ssh -f $PC \"pidof -x $opt_s | xargs kill -9; sleep 1; $opt_s $args & \" ");
+               print "my_restart_handler: kill and restart...\n";
+               system("ssh  $PC \"pidof -x $opt_s | xargs kill -9; sleep 1; $opt_s $args & \" ");
            }
-           elsif($opt_r){
+           #elsif($opt_r){
+           else {
                #--- restart
-               system("ssh -f $PC \"$opt_s $args & \" ");
+               print "my_restart_handler: restart...\n";
+               print "ssh  $PC \"$opt_s $args & \" ";
+               system("ssh  $PC \"$opt_s $args & \" ");
+               
            }
        }
        else{
            #--- restart without killing
-           my $command = "ssh  -f $PC \"$opt_s $args& \" ";
+           print "my_restart_handler: just start...\n";
+           my $command = "ssh   $PC \"$opt_s $args & \" ";
            system($command);
        }
     }