#--- 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);
}
}