Perlbal::Control - Simple class to manage perlbal
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';
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.
This is a Path::Class::File instance for the configuration file.
This is a Path::Class::File instance pointing to the perlbal binary. This can be autodiscovered or you can specify it via the constructor.
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.
Starts the perlbal deamon that is currently being controlled by this instance. It will also run the pre_startup and post_startup hooks.
Stops the perlbal deamon that is currently being controlled by this instance. It will also run the pre_shutdown and post_shutdown hooks.
This is the PID of the live server.
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).
depends on $ctl->verbose.
<fayland at gmail.com>
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.