CVS User Account cvsuser
Thu Feb 10 06:22:49 PST 2005
Log Message:
-----------
Use fixed paths for altperl tools configuration and library files.

The configuration file defaults to the "sysconfdir" argument to
configure (/usr/local/etc by default), and has been renamed to
slon_tools.conf, which seems to go along with the naming convention of
the configuration files in /usr/local/pgsql/data.

The slon-tools.pm library is installed in the pglibdir path.

I've also updated the relevant documentation to note the slon.env name
change.

Modified Files:
--------------
    slony1-engine/doc/adminguide:
        adminscripts.sgml (r1.15 -> r1.16)
    slony1-engine/tools/altperl:
        README (r1.9 -> r1.10)
        build_env.pl (r1.7 -> r1.8)
        create_set.pl (r1.11 -> r1.12)
        drop_node.pl (r1.7 -> r1.8)
        drop_set.pl (r1.7 -> r1.8)
        failover.pl (r1.6 -> r1.7)
        init_cluster.pl (r1.9 -> r1.10)
        merge_sets.pl (r1.7 -> r1.8)
        move_set.pl (r1.6 -> r1.7)
        restart_node.pl (r1.5 -> r1.6)
        restart_nodes.pl (r1.5 -> r1.6)
        show_configuration.pl (r1.4 -> r1.5)
        slon_kill.pl (r1.9 -> r1.10)
        slon_pushsql.pl (r1.7 -> r1.8)
        slon_start.pl (r1.10 -> r1.11)
        slon_watchdog2.pl (r1.7 -> r1.8)
        slon_watchdog.pl (r1.7 -> r1.8)
        subscribe_set.pl (r1.7 -> r1.8)
        uninstall_nodes.pl (r1.6 -> r1.7)
        unsubscribe_set.pl (r1.5 -> r1.6)
        update_nodes.pl (r1.4 -> r1.5)

Added Files:
-----------
    slony1-engine/tools/altperl:
        slon_tools.conf-sample (r1.1)

Removed Files:
-------------
    slony1-engine/tools/altperl:
        slon.env

-------------- next part --------------
Index: adminscripts.sgml
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/doc/adminguide/adminscripts.sgml,v
retrieving revision 1.15
retrieving revision 1.16
diff -Ldoc/adminguide/adminscripts.sgml -Ldoc/adminguide/adminscripts.sgml -u -w -r1.15 -r1.16
--- doc/adminguide/adminscripts.sgml
+++ doc/adminguide/adminscripts.sgml
@@ -105,7 +105,7 @@
 <sect2><title>build_env.pl</title>
 
 <para>Queries a database, generating output hopefully suitable for
-<filename>slon.env</filename> consisting of:</para>
+<filename>slon_tools.conf</filename> consisting of:</para>
 <itemizedlist>
 
 <listitem><para> a set of <function>add_node()</function> calls to configure the cluster</para></listitem>
Index: merge_sets.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/merge_sets.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/merge_sets.pl -Ltools/altperl/merge_sets.pl -u -w -r1.7 -r1.8
--- tools/altperl/merge_sets.pl
+++ tools/altperl/merge_sets.pl
@@ -5,11 +5,12 @@
 
 use Getopt::Long;
 
-$SLON_ENV_FILE = 'slon.env'; # Where to find the slon.env file
-$SHOW_USAGE    = 0;          # Show usage, then quit
+# Defaults
+$CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
+$SHOW_USAGE  = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s" => \$CONFIG_FILE,
 	   "help"      => \$SHOW_USAGE);
 
 my $USAGE =
@@ -24,8 +25,8 @@
   exit 0;
 }
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
 
 my ($node, $set1, $set2) = @ARGV;
 if ($node =~ /^(?:node)?(\d+)$/) {
Index: create_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/create_set.pl,v
retrieving revision 1.11
retrieving revision 1.12
diff -Ltools/altperl/create_set.pl -Ltools/altperl/create_set.pl -u -w -r1.11 -r1.12
--- tools/altperl/create_set.pl
+++ tools/altperl/create_set.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 my ($set) = @ARGV;
 if ($set =~ /^set(\d+)$/) {
   $set = $1;
Index: subscribe_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/subscribe_set.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/subscribe_set.pl -Ltools/altperl/subscribe_set.pl -u -w -r1.7 -r1.8
--- tools/altperl/subscribe_set.pl
+++ tools/altperl/subscribe_set.pl
@@ -5,11 +5,12 @@
 
 use Getopt::Long;
 
-$SLON_ENV_FILE = 'slon.env'; # Where to find the slon.env file
-$SHOW_USAGE    = 0;          # Show usage, then quit
+# Defaults
+$CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
+$SHOW_USAGE  = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s"  => \$CONFIG_FILE,
 	   "help"      => \$SHOW_USAGE);
 
 my $USAGE =
@@ -24,8 +25,8 @@
   exit 0;
 }
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
 
 my ($set, $node) = @ARGV;
 if ($node =~ /^(?:node)?(\d+)$/) {
Index: init_cluster.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/init_cluster.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -Ltools/altperl/init_cluster.pl -Ltools/altperl/init_cluster.pl -u -w -r1.9 -r1.10
--- tools/altperl/init_cluster.pl
+++ tools/altperl/init_cluster.pl
@@ -5,16 +5,14 @@
 
 use Getopt::Long;
 
-my $SLON_ENV_FILE = 'slon.env'; # Where to find the slon.env file
-my $SHOW_USAGE    = 0;          # Show usage, then quit
+# Defaults
+my $CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
+my $SHOW_USAGE  = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s" => \$CONFIG_FILE,
 	   "help"      => \$SHOW_USAGE);
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
-
 my $USAGE =
 "Usage: init_cluster.pl [--config file]
 
@@ -29,6 +27,9 @@
   exit 0;
 }
 
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
+
 my $FILE="/tmp/init-cluster.$$";
 
 # INIT CLUSTER
--- tools/altperl/slon.env
+++ /dev/null
@@ -1,124 +0,0 @@
-# $Id: slon.env,v 1.10 2005/02/02 17:25:30 cbbrowne Exp $
-# Author: Christopher Browne
-# Copyright 2004 Afilias Canada
-# Revised extensively by Steve Simms
-
-# Keeping the following three lines for backwards compatibility in
-# case this gets incorporated into a 1.0.6 release.
-#
-# TODO: The scripts should check for an environment variable
-# containing the location of a configuration file.  That would
-# simplify this configuration file and allow Slony-I tools to still work
-# in situations where it doesn't exist.
-#
-if ($ENV{"SLONYNODES"}) {
-    require $ENV{"SLONYNODES"};
-} else {
-
-    # The name of the replication cluster.  This will be used to
-    # create a schema named _$CLUSTER_NAME in the database which will
-    # contain Slony-related data.
-    $CLUSTER_NAME = 'replication';
-
-    # The directory where Slony should record log messages.  This
-    # directory will need to be writable by the user that invokes
-    # Slony.
-    $LOGDIR = '/var/log/slony';
-
-    # The directory containing the slon and slonik executables
-    $SLON_BIN_PATH = '/usr/local/pgsql/bin';
-
-    # (Optional) If you would like to use Apache's rotatelogs tool to
-    # manage log output, uncomment the following line and ensure that
-    # it points to the executable.
-    #
-    # $APACHE_ROTATOR = '/usr/local/apache/bin/rotatelogs';
-
-    # Which node is the default master for all sets?
-    $MASTERNODE = 1;
-
-    # Include add_node lines for each node in the cluster.  Be sure to
-    # use host names that will resolve properly on all nodes
-    # (i.e. only use 'localhost' if all nodes are on the same host).
-    # Also, note that the user must be a superuser account.
-
-    add_node(node     => 1,
-	     host     => 'server1',
-	     dbname   => 'database',
-	     port     => 5432,
-	     user     => 'postgres',
-             password => '');
-
-    add_node(node     => 2,
-	     parent   => 1,
-	     host     => 'server2',
-	     dbname   => 'database',
-	     port     => 5432,
-	     user     => 'postgres',
-             password => '');
-
-    add_node(node     => 3,
-	     parent   => 1,
-	     host     => 'server3',
-	     dbname   => 'database',
-	     port     => 5432,
-	     user     => 'postgres',
-             password => '');
-}
-
-# Keeping the following three lines for backwards compatibility in
-# case this gets incorporated into a 1.0.6 release.
-#
-# TODO: The scripts should check for an environment variable
-# containing the location of a configuration file.  That would
-# simplify this configuration file and allow Slony tools to still work
-# in situations where it doesn't exist.
-#
-if ($ENV{"SLONYSET"}) {
-    require $ENV{"SLONYSET"};
-} else {
-
-    # The first ID to use for tables and sequences that are added to
-    # the replication cluster.  This must be unique across the
-    # cluster.
-    # 
-    # TODO: This should be determined automatically, which can be done
-    # fairly easily in most cases using psql.  create_set should
-    # derive it, and give an option to override it with a specific
-    # value.
-    $TABLE_ID    = 1;
-    $SEQUENCE_ID = 1;
-
-    # This array contains a list of tables that already have primary
-    # keys.
-    @PKEYEDTABLES=(
-		   'table1',
-		   'table2'
-		   );
-
-    # For tables that have unique not null keys, but no primary key,
-    # enter their names and indexes here.
-    %KEYEDTABLES=(
-		  'table3' => 'index_on_table3',
-		  'table4' => 'index_on_table4'
-		  );
-
-    # If a table does not have a suitable key or set of keys that can
-    # act as a primary key, Slony can add one.
-    #
-    # Note: The Slony development team does not recomment this
-    # approach -- you should create your own primary keys instead.
-    @SERIALTABLES=(
-		   'table5'
-		   );
-
-    # Sequences that need to be replicated should be entered here.
-    @SEQUENCES=(
-		'sequence1',
-		'sequence2'
-		);
-
-}
-
-# Please do not add or change anything below this point.
-1;
Index: drop_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/drop_set.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/drop_set.pl -Ltools/altperl/drop_set.pl -u -w -r1.7 -r1.8
--- tools/altperl/drop_set.pl
+++ tools/altperl/drop_set.pl
@@ -5,11 +5,12 @@
 
 use Getopt::Long;
 
-$SLON_ENV_FILE = 'slon.env'; # Where to find the slon.env file
-$SHOW_USAGE    = 0;          # Show usage, then quit
+# Defaults
+$CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
+$SHOW_USAGE  = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s" => \$CONFIG_FILE,
 	   "help"      => \$SHOW_USAGE);
 
 my $USAGE =
@@ -24,8 +25,8 @@
   exit 0;
 }
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
 
 my ($set) = @ARGV;
 if ($set =~ /^(?:set)?(\d+)$/) {
Index: slon_start.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_start.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -Ltools/altperl/slon_start.pl -Ltools/altperl/slon_start.pl -u -w -r1.10 -r1.11
--- tools/altperl/slon_start.pl
+++ tools/altperl/slon_start.pl
@@ -6,13 +6,13 @@
 use Getopt::Long;
 
 # Defaults
-$START_WATCHDOG = 1;          # Whether or not the watchdog process should be started
-$SLEEP_TIME     = 30;         # Number of seconds for watchdog to sleep
-$SLON_ENV_FILE  = 'slon.env'; # Where to find the slon.env file
-$SHOW_USAGE     = 0;          # Show usage, then quit
+$START_WATCHDOG = 1;
+$SLEEP_TIME     = 30;
+$CONFIG_FILE    = '@@SYSCONFDIR@@/slon_tools.conf';
+$SHOW_USAGE     = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s"  => \$CONFIG_FILE,
 	   "watchdog!" => \$START_WATCHDOG,
 	   "sleep=i"   => \$SLEEP_TIME,
 	   "help"      => \$SHOW_USAGE);
@@ -21,7 +21,7 @@
 "Usage: slon_start.pl [--config file] [--watchdog|--nowatchdog]
        [--sleep seconds] node#
 
-    --config file    Location of the slon.env file (default: Perl's \@INC)
+    --config file    Location of the slon_tools.conf file
 
     --watchdog       Start a watchdog process after starting the slon
                      daemon (default)
@@ -37,8 +37,8 @@
   die $USAGE;
 }
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
 
 $node = $ARGV[0];
 
@@ -67,6 +67,6 @@
   print "PID [$pid]\n";
   if ($START_WATCHDOG) {
     print "Start the watchdog process as well...\n";
-    system "perl slon_watchdog.pl --config=$SLON_ENV_FILE $node $SLEEP_TIME &";
+    system "perl slon_watchdog.pl --config=$CONFIG_FILE $node $SLEEP_TIME &";
   }
 }
Index: unsubscribe_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/unsubscribe_set.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ltools/altperl/unsubscribe_set.pl -Ltools/altperl/unsubscribe_set.pl -u -w -r1.5 -r1.6
--- tools/altperl/unsubscribe_set.pl
+++ tools/altperl/unsubscribe_set.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 my ($set, $node) = @ARGV;
 if ($node =~ /^node(\d+)$/) {
Index: restart_node.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/restart_node.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ltools/altperl/restart_node.pl -Ltools/altperl/restart_node.pl -u -w -r1.5 -r1.6
--- tools/altperl/restart_node.pl
+++ tools/altperl/restart_node.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 my ($node) = @_;
 if ($node =~ /^node(\d+)$/) {
Index: failover.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/failover.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Ltools/altperl/failover.pl -Ltools/altperl/failover.pl -u -w -r1.6 -r1.7
--- tools/altperl/failover.pl
+++ tools/altperl/failover.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 my ($node1, $set1, $node2) = @ARGV;
 if ($node1 =~ /^node(\d+)$/) {
Index: drop_node.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/drop_node.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/drop_node.pl -Ltools/altperl/drop_node.pl -u -w -r1.7 -r1.8
--- tools/altperl/drop_node.pl
+++ tools/altperl/drop_node.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 my ($node) = @ARGV;
 if ($node =~ /^node(\d+)$/) {
Index: slon_watchdog2.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_watchdog2.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/slon_watchdog2.pl -Ltools/altperl/slon_watchdog2.pl -u -w -r1.7 -r1.8
--- tools/altperl/slon_watchdog2.pl
+++ tools/altperl/slon_watchdog2.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 $node =$ARGV[0];
 $sleep =$ARGV[1];
Index: restart_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/restart_nodes.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -Ltools/altperl/restart_nodes.pl -Ltools/altperl/restart_nodes.pl -u -w -r1.5 -r1.6
--- tools/altperl/restart_nodes.pl
+++ tools/altperl/restart_nodes.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 my $FILE="/tmp/restart.$$";
 foreach my $node (@NODES) {
Index: slon_watchdog.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_watchdog.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/slon_watchdog.pl -Ltools/altperl/slon_watchdog.pl -u -w -r1.7 -r1.8
--- tools/altperl/slon_watchdog.pl
+++ tools/altperl/slon_watchdog.pl
@@ -6,17 +6,17 @@
 use Getopt::Long;
 
 # Defaults
-$SLON_ENV_FILE  = 'slon.env'; # Where to find the slon.env file
-$SHOW_USAGE     = 0;          # Show usage, then quit
+$CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
+$SHOW_USAGE  = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s"  => \$CONFIG_FILE,
 	   "help"      => \$SHOW_USAGE);
 
 my $USAGE =
 "Usage: slon_watchdog.pl [--config file] node# sleep_seconds
 
-    --config file  Location of the slon.env file (default: Perl's \@INC)
+    --config file  Location of the slon_tools.conf file
 
     sleep_seconds  Number of seconds for the watchdog process to sleep
                    between checks
@@ -27,8 +27,8 @@
   die $USAGE;
 }
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
 
 $node = $ARGV[0];
 $sleep = $ARGV[1];
Index: uninstall_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/uninstall_nodes.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Ltools/altperl/uninstall_nodes.pl -Ltools/altperl/uninstall_nodes.pl -u -w -r1.6 -r1.7
--- tools/altperl/uninstall_nodes.pl
+++ tools/altperl/uninstall_nodes.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 $FILE="/tmp/slonik.$$";
 open(SLONIK, ">$FILE");
--- /dev/null
+++ tools/altperl/slon_tools.conf-sample
@@ -0,0 +1,124 @@
+# $Id: slon_tools.conf-sample,v 1.1 2005/02/10 06:22:41 smsimms Exp $
+# Author: Christopher Browne
+# Copyright 2004 Afilias Canada
+# Revised extensively by Steve Simms
+
+# Keeping the following three lines for backwards compatibility in
+# case this gets incorporated into a 1.0.6 release.
+#
+# TODO: The scripts should check for an environment variable
+# containing the location of a configuration file.  That would
+# simplify this configuration file and allow Slony-I tools to still work
+# in situations where it doesn't exist.
+#
+if ($ENV{"SLONYNODES"}) {
+    require $ENV{"SLONYNODES"};
+} else {
+
+    # The name of the replication cluster.  This will be used to
+    # create a schema named _$CLUSTER_NAME in the database which will
+    # contain Slony-related data.
+    $CLUSTER_NAME = 'replication';
+
+    # The directory where Slony should record log messages.  This
+    # directory will need to be writable by the user that invokes
+    # Slony.
+    $LOGDIR = '/var/log/slony';
+
+    # The directory containing the slon and slonik executables
+    $SLON_BIN_PATH = '/usr/local/pgsql/bin';
+
+    # (Optional) If you would like to use Apache's rotatelogs tool to
+    # manage log output, uncomment the following line and ensure that
+    # it points to the executable.
+    #
+    # $APACHE_ROTATOR = '/usr/local/apache/bin/rotatelogs';
+
+    # Which node is the default master for all sets?
+    $MASTERNODE = 1;
+
+    # Include add_node lines for each node in the cluster.  Be sure to
+    # use host names that will resolve properly on all nodes
+    # (i.e. only use 'localhost' if all nodes are on the same host).
+    # Also, note that the user must be a superuser account.
+
+    add_node(node     => 1,
+	     host     => 'server1',
+	     dbname   => 'database',
+	     port     => 5432,
+	     user     => 'postgres',
+             password => '');
+
+    add_node(node     => 2,
+	     parent   => 1,
+	     host     => 'server2',
+	     dbname   => 'database',
+	     port     => 5432,
+	     user     => 'postgres',
+             password => '');
+
+    add_node(node     => 3,
+	     parent   => 1,
+	     host     => 'server3',
+	     dbname   => 'database',
+	     port     => 5432,
+	     user     => 'postgres',
+             password => '');
+}
+
+# Keeping the following three lines for backwards compatibility in
+# case this gets incorporated into a 1.0.6 release.
+#
+# TODO: The scripts should check for an environment variable
+# containing the location of a configuration file.  That would
+# simplify this configuration file and allow Slony tools to still work
+# in situations where it doesn't exist.
+#
+if ($ENV{"SLONYSET"}) {
+    require $ENV{"SLONYSET"};
+} else {
+
+    # The first ID to use for tables and sequences that are added to
+    # the replication cluster.  This must be unique across the
+    # cluster.
+    # 
+    # TODO: This should be determined automatically, which can be done
+    # fairly easily in most cases using psql.  create_set should
+    # derive it, and give an option to override it with a specific
+    # value.
+    $TABLE_ID    = 1;
+    $SEQUENCE_ID = 1;
+
+    # This array contains a list of tables that already have primary
+    # keys.
+    @PKEYEDTABLES=(
+		   'table1',
+		   'table2'
+		   );
+
+    # For tables that have unique not null keys, but no primary key,
+    # enter their names and indexes here.
+    %KEYEDTABLES=(
+		  'table3' => 'index_on_table3',
+		  'table4' => 'index_on_table4'
+		  );
+
+    # If a table does not have a suitable key or set of keys that can
+    # act as a primary key, Slony can add one.
+    #
+    # Note: The Slony development team does not recomment this
+    # approach -- you should create your own primary keys instead.
+    @SERIALTABLES=(
+		   'table5'
+		   );
+
+    # Sequences that need to be replicated should be entered here.
+    @SEQUENCES=(
+		'sequence1',
+		'sequence2'
+		);
+
+}
+
+# Please do not add or change anything below this point.
+1;
Index: move_set.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/move_set.pl,v
retrieving revision 1.6
retrieving revision 1.7
diff -Ltools/altperl/move_set.pl -Ltools/altperl/move_set.pl -u -w -r1.6 -r1.7
--- tools/altperl/move_set.pl
+++ tools/altperl/move_set.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 my ($set, $node1, $node2) = @ARGV;
 if ($set =~ /^set(\d+)$/) {
Index: show_configuration.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/show_configuration.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltools/altperl/show_configuration.pl -Ltools/altperl/show_configuration.pl -u -w -r1.4 -r1.5
--- tools/altperl/show_configuration.pl
+++ tools/altperl/show_configuration.pl
@@ -6,8 +6,8 @@
 # This script simply displays an overview of node configuration
 # for a given SLONY node set
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 print "Slony Configuration\n-------------------------------------\n";
 if ($ENV{"SLONYNODES"}) {
Index: build_env.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/build_env.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/build_env.pl -Ltools/altperl/build_env.pl -u -w -r1.7 -r1.8
--- tools/altperl/build_env.pl
+++ tools/altperl/build_env.pl
@@ -1,11 +1,11 @@
-#!@@PERl@@
+#!@@PERL@@
 # $Id$
 # Contributed by:
 # Joe Kalash
 # kalash at savicom.net
 
 # This script, given parameters concerning the database nodes,
-# generates output for "slon.env" consisting of:
+# generates output for "slon_tools.conf" consisting of:
 # - A set of add_node() calls to configure the cluster
 # - The arrays @KEYEDTABLES, @SERIALTABLES, and @SEQUENCES
 
Index: slon_pushsql.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_pushsql.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -Ltools/altperl/slon_pushsql.pl -Ltools/altperl/slon_pushsql.pl -u -w -r1.7 -r1.8
--- tools/altperl/slon_pushsql.pl
+++ tools/altperl/slon_pushsql.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 my ($set, $node, $file) = @ARGV;
 if ($set =~ /^set(\d+)$/) {
   $set = $1;
Index: slon_kill.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/slon_kill.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -Ltools/altperl/slon_kill.pl -Ltools/altperl/slon_kill.pl -u -w -r1.9 -r1.10
--- tools/altperl/slon_kill.pl
+++ tools/altperl/slon_kill.pl
@@ -6,11 +6,12 @@
 
 use Getopt::Long;
 
-$SLON_ENV_FILE = 'slon.env'; # Where to find the slon.env file
-$SHOW_USAGE    = 0;          # Show usage, then quit
+# Defaults
+$CONFIG_FILE = '@@SYSCONFDIR@@/slon_tools.conf';
+$SHOW_USAGE  = 0;
 
 # Read command-line options
-GetOptions("config=s"  => \$SLON_ENV_FILE,
+GetOptions("config=s"  => \$CONFIG_FILE,
 	   "help"      => \$SHOW_USAGE);
 
 my $USAGE =
@@ -26,8 +27,8 @@
   exit 0;
 }
 
-require 'slon-tools.pm';
-require $SLON_ENV_FILE;
+require '@@PGLIBDIR@@/slon-tools.pm';
+require $CONFIG_FILE;
 
 print "slon_kill.pl...   Killing all slon and slon_watchdog instances for the cluster $CLUSTER_NAME\n";
 print "1.  Kill slon watchdogs\n";
Index: update_nodes.pl
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/update_nodes.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -Ltools/altperl/update_nodes.pl -Ltools/altperl/update_nodes.pl -u -w -r1.4 -r1.5
--- tools/altperl/update_nodes.pl
+++ tools/altperl/update_nodes.pl
@@ -3,8 +3,8 @@
 # Author: Christopher Browne
 # Copyright 2004 Afilias Canada
 
-require 'slon-tools.pm';
-require 'slon.env';
+require '@@PGLIBDIR@@/slon-tools.pm';
+require '@@SYSCONFDIR@@/slon_tools.conf';
 
 open(SLONIK, ">/tmp/update_nodes.$$");
 print SLONIK genheader();
Index: README
===================================================================
RCS file: /usr/local/cvsroot/slony1/slony1-engine/tools/altperl/README,v
retrieving revision 1.9
retrieving revision 1.10
diff -Ltools/altperl/README -Ltools/altperl/README -u -w -r1.9 -r1.10
--- tools/altperl/README
+++ tools/altperl/README
@@ -21,7 +21,7 @@
 
 This configuration will normally apply to all clusters being managed
 on a particular host, so it would probably make sense to modify it
-directly in slon.env.
+directly in slon_tools.conf.
 
  $SLON_BIN_PATH is the path to use to find the slon and slonik
    binaries.
@@ -75,12 +75,12 @@
   @SEQUENCES lists all of the application sequences that are to be
              replicated.
 
-The values in slon.env are "hardcoded" as far as the tools are
+The values in slon_tools.conf are "hardcoded" as far as the tools are
 concerned.
 
-To make this more flexible, slon.env also looks at the environment
-variables SLONYNODES and SLONYSET as alternative sources for
-configuration.
+To make this more flexible, slon_tools.conf also looks at the
+environment variables SLONYNODES and SLONYSET as alternative sources
+for configuration.
 
 That way, you may do something like:
 


More information about the Slony1-commit mailing list