From a699dbcb42e2ed4be5241481f1ab1d9bafc85b78 Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 14 Feb 2012 15:39:40 +0000 Subject: [PATCH] JAM: modified restart handler, still testing. --- plugins/my_restart_handler.pl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/plugins/my_restart_handler.pl b/plugins/my_restart_handler.pl index 02a2c37..7cd60a5 100755 --- a/plugins/my_restart_handler.pl +++ b/plugins/my_restart_handler.pl @@ -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); } } -- 2.43.0