]> jspc29.x-matter.uni-frankfurt.de Git - hadesicinga.git/commitdiff
JAM: added redirection of stdout and stderr to null for all remote commands
authorhadaq <hadaq>
Wed, 15 Feb 2012 10:17:27 +0000 (10:17 +0000)
committerhadaq <hadaq>
Wed, 15 Feb 2012 10:17:27 +0000 (10:17 +0000)
note that this may conflict with demonize option of some perl script

plugins/my_restart_handler.pl

index 7cd60a584d04fb1cc5d5f72d43ddb340a845c59e..f42f761d46e4fd3afd7df5301291c02b07144ad6 100755 (executable)
@@ -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);
        }
     }