Ian Burrell ianburrell
Mon Jul 25 23:25:07 PDT 2005
To make an init script easier, and because I am tired of doing
slon_start multiple times, I give you slon_start_all which runs
slon_start on all the nodes in the cluster.  It passes all the options
through to slon_start.

 - Ian


#!@@PERL@@

use Getopt::Long;

# Defaults
my $CONFIG_FILE    = '@@SYSCONFDIR@@/slon_tools.conf';
my $SHOW_USAGE     = 0;

# Read command-line options
GetOptions("config=s"  => \$CONFIG_FILE,
	   "help"      => \$SHOW_USAGE);

my $USAGE =
"Usage: slon_start_all [--config file] [--watchdog|--nowatchdog]
       [--sleep seconds]

    --config file    Location of the slon_tools.conf file

    --watchdog       Start a watchdog process after starting the slon
                     daemon (default)

    --nowatchdog     Do not start a watchdog process

    --sleep seconds  Number of seconds for the watchdog process to sleep
                     between checks (default 30)

";

if ($SHOW_USAGE) {
    die $USAGE;
}

require '@@PGLIBDIR@@/slon-tools.pm';
require $CONFIG_FILE;

foreach my $nodenum (@NODES) {
    system('slon_start', @ARGV, $nodenum);
}


More information about the Slony1-general mailing list