#!/usr/bin/perl -w # =head1 NAME Perlbal - Reverse-proxy load balancer and webserver =head1 DESCRIPTION For now, see example configuration files in conf/ =head1 AUTHORS Brad Fitzpatrick, Mark Smith, =head1 SEE ALSO http://www.danga.com/perlbal/ =head1 COPYRIGHT AND LICENSE Copyright 2004, Danga Interactive, Inc. Copyright 2005-2007, Six Apart, Ltd. You can use and redistribute Perlbal under the same terms as Perl itself. =cut use strict; use warnings; use lib 'lib'; use Perlbal; my $opt_daemonize; my $opt_config; my $opt_help; my $opt_version; usage(1) unless Getopt::Long::GetOptions( 'daemon' => \$opt_daemonize, 'config=s' => \$opt_config, 'help' => \$opt_help, 'version' => \$opt_version, ); my $default_config = "/etc/perlbal/perlbal.conf"; $opt_config = $default_config if ! $opt_config && -e $default_config; usage(0) if $opt_help; sub usage { my $rv = shift; print STDERR <WatchedSockets() > 0) { die "No services or management port configured. Nothing to do. Stopping.\n"; } if ($opt_daemonize) { Perlbal::daemonize(); } else { print "Running.\n"; } exit 0 if Perlbal::run(); exit 1; # Local Variables: # mode: perl # c-basic-indent: 4 # indent-tabs-mode: nil # End: