From: hadaq Date: Wed, 15 Feb 2012 10:17:27 +0000 (+0000) Subject: JAM: added redirection of stdout and stderr to null for all remote commands X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=0608e4fe71dcbb25ceaa263ef86469645958912d;p=hadesicinga.git JAM: added redirection of stdout and stderr to null for all remote commands note that this may conflict with demonize option of some perl script --- diff --git a/plugins/my_restart_handler.pl b/plugins/my_restart_handler.pl index 7cd60a5..f42f761 100755 --- a/plugins/my_restart_handler.pl +++ b/plugins/my_restart_handler.pl @@ -88,21 +88,21 @@ sub main elsif($out && $opt_r){ #--- kill and restart print "my_restart_handler: kill and restart...\n"; - system("ssh $PC \"pidof -x $opt_s | xargs kill -9; sleep 1; $opt_s $args & \" "); + system("ssh $PC \"pidof -x $opt_s | xargs kill -9; sleep 1; $opt_s $args >/dev/null 2>&1 & \" "); } #elsif($opt_r){ else { #--- restart print "my_restart_handler: restart...\n"; print "ssh $PC \"$opt_s $args & \" "; - system("ssh $PC \"$opt_s $args & \" "); + system("ssh $PC \"$opt_s $args >/dev/null 2>&1 & \" "); } } else{ #--- restart without killing print "my_restart_handler: just start...\n"; - my $command = "ssh $PC \"$opt_s $args & \" "; + my $command = "ssh $PC \"$opt_s $args >/dev/null 2>&1 & \" "; system($command); } }