[Pkg-grid-commits] nws/debian nws_setup,1.1,1.2

Martin Quinson mquinson at alioth.debian.org
Mon Aug 8 21:29:06 UTC 2005


Update of /cvsroot/pkg-grid/nws/debian
In directory haydn:/tmp/cvs-serv8206

Modified Files:
	nws_setup 
Log Message:
Try to catch the garbbage nws_ctrl spits out when testing a dead host; choke on unknown command line option

Index: nws_setup
===================================================================
RCS file: /cvsroot/pkg-grid/nws/debian/nws_setup,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- nws_setup	8 Aug 2005 20:03:17 -0000	1.1
+++ nws_setup	8 Aug 2005 21:29:04 -0000	1.2
@@ -59,6 +59,8 @@
 	$verbose = 1;
     } elsif ($optname =~ /conffile/ || $optname =~ /^c$/) {
 	$whereconf= shift @ARGV;
+    } else {
+	die "Unknown option: $opt\n";
     }
 }
 unshift @ARGV,$opt;
@@ -516,8 +518,9 @@
 
 sub test {
     my $part=shift;
+    my $cmd = "$howto{'test'}{$part}".($verbose?"":" 2>&1");
 
-    my $res=qx,$howto{'test'}{$part},;
+    my $res=qx,$cmd,;
     chomp($res);
     $res=~ s/^.*?\s(\S*)$/$1/;
     return $res;
@@ -703,7 +706,8 @@
 	foreach $i (split(/\s+/,$stop_part)) {
 	    printf " $i";
 	  WAIT: for (my $j=0;$j<10;$j++){
-	      qx,$howto{"stop"}{$i},;
+	      my $cmdline = $howto{"stop"}{$i}.($verbose?"":" 2>&1");
+	      qx,$cmdline,;
 	      $status=test($i);
 	      last WAIT if ($status eq "dead");
 	      printf "." if $verbose;




More information about the Pkg-grid-commits mailing list