NAME
Perlbal::Control - Simple class to manage perlbal
SYNOPSIS
use Perlbal::Control;
my ($command) = @ARGV;
my $ctl = Perlbal::Control->new(
config_file => [qw[ conf perlbal.conf ]],
# PID file can also be discovered automatically
# from the conf, or if you prefer you can specify
pid_file => 'perlbal.pid',
);
$ctl->start if lc($command) eq 'start';
$ctl->stop if lc($command) eq 'stop';
DESCRIPTION
This is a fork of Lighttpd::Control to work with Perlbal, it maintains 100% API compatibility. In fact most of this documentation was stolen too. This is an early release with only the bare bones functionality needed, future releases will surely include more functionality. Suggestions and crazy ideas welcomed, especially in the form of patches with tests.
ATTRIBUTES
- config_file
-
This is a Path::Class::File instance for the configuration file.
- binary_path
-
This is a Path::Class::File instance pointing to the perlbal binary. This can be autodiscovered or you can specify it via the constructor.
- pid_file
-
This is a Path::Class::File instance pointing to the perlbal pid file. This can be autodiscovered from the config file or you can specify it via the constructor. it is optional.
METHODS
- start
-
Starts the perlbal deamon that is currently being controlled by this instance. It will also run the pre_startup and post_startup hooks.
- stop
-
Stops the perlbal deamon that is currently being controlled by this instance. It will also run the pre_shutdown and post_shutdown hooks.
- get_server_pid
-
This is the PID of the live server.
- is_server_running
-
Checks to see if the perlbal deamon that is currently being controlled by this instance is running or not (based on the state of the PID file).
- debug
-
depends on $ctl->verbose.
SEE ALSO
MooseX::Control, Lighttpd::Control, Nginx::Control, Sphinx::Control
AUTHOR
Fayland Lam, <fayland at gmail.com>
COPYRIGHT & LICENSE
Copyright 2008 Fayland Lam
except for those parts that are
Copyright 2008 Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.