| 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);
}
|