CVS User Account cvsuser
Wed Mar 16 20:37:56 PST 2005
Log Message:
-----------
Add an option to only kill watchdogs, not slons.

Some mild reformatting as well.

Modified Files:
--------------
    slony1-engine/tools/altperl:
        slon_kill.pl (r1.11 -> r1.12)

-------------- next part --------------
Index: slon_kill.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_kill.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -Ltools/altperl/slon_kill.pl -Ltools/altperl/slon_kill.pl -u -w -r1.11 -r1.12
--- tools/altperl/slon_kill.pl
+++ tools/altperl/slon_kill.pl
@@ -1,6 +1,6 @@
 #!@@PERL@@
 # $Id$
-# Kill all slon instances for the current setname
+# Kill all slon instances for the current cluster
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
@@ -9,16 +9,23 @@
 # Defaults
 $CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
 $SHOW_USAGE  = 0;
+$WATCHDOG_ONLY = 0;
 
 # Read command-line options
 GetOptions("config=s"  => \$CONFIG_FILE,
-	   "help"      => \$SHOW_USAGE);
+	   "help"       => \$SHOW_USAGE,
+	   "w|watchdog" => \$WATCHDOG_ONLY);
 
 my $USAGE =
-"Usage: slon_kill [--config file]
+"Usage: slon_kill [--config file] [-w|--watchdog]
 
-   Kills all running slon and slon_watchdog instances for the set
-   specified in the config file.
+    --config file  Location of the slon_tools.conf file
+
+    -w
+    --watchdog     Only kill the watchdog process(es)
+
+    Kills all running slon and slon_watchdog on this machine for every
+    node in the cluster.
 
 ";
 
@@ -32,14 +39,16 @@
 
 print "slon_kill.pl...   Killing all slon and slon_watchdog instances for the cluster $CLUSTER_NAME\n";
 print "1.  Kill slon watchdogs\n";
-# kill the watchdog
 
+# kill the watchdog
 open(PSOUT, ps_args() . " | egrep '[s]lon_watchdog' | sort -n | awk '{print \$2}'|");
 shut_off_processes();
 close(PSOUT);
 if ($found eq 'n') {
   print "No watchdogs found\n";
 }
+
+unless ($WATCHDOG_ONLY) {
 print "\n2. Kill slon processes\n";
 
 # kill the slon daemon
@@ -50,6 +59,7 @@
 if ($found eq 'n') {
   print "No slon processes found\n";
 }
+}
 
 sub shut_off_processes {
   $found="n";


More information about the Slony1-commit mailing list