Home > Archive > Slony1 PostgreSQL Replication > July 2005 > New script tools/altperl/slon_start_all.pl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author New script tools/altperl/slon_start_all.pl
Ian Burrell

2005-07-25, 8:29 pm

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 =3D '@@SYSCONFDIR@@/slon_tools.conf';
my $SHOW_USAGE =3D 0;

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

my $USAGE =3D
"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);
}
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com