From: hadaq Date: Tue, 14 Feb 2012 15:39:40 +0000 (+0000) Subject: JAM: modified restart handler, still testing. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a699dbcb42e2ed4be5241481f1ab1d9bafc85b78;p=hadesicinga.git JAM: modified restart handler, still testing. --- 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); } }