Haineko::CLI::Daemon - Haineko server control class
Haineko::CLI::Daemon provide methods for controlling Haineko server: to start, stop, reload, and restart server.
use Haineko::CLI::Daemon; my $p = { 'pidfile' => '/tmp/haineko.pid' }; my $d = Haineko::CLI::Daemon->new( %$p ); $d->parseoptions; # Parse command-line options $d->makepf; # Make a pid file $d->run; # Start haineko server $d->ctrl('stop'); # Stop haineko server $d->ctrl('reload'); # Send ``USR1'' signal to the server $d->ctrl('restart');# Send ``HUP'' signal to the server
run()
run() method starts haineko server
my $p = { 'pidfile' => '/tmp/haineko.pid' }; my $e = Haineko::CLI::Daemon->new( %$p ); $e->parseoptions; $e->run;
ctrl( action )
ctrl() is a method for controlling haineko server process. ctrl('start') calls run() method, ctrl('stop') stops running haineko server, ctrl('reload') sends USR1 signal to the server, and ctrl('restart') sends HUP signal to the server.
ctrl()
ctrl('start')
ctrl('stop')
ctrl('reload')
USR1
ctrl('restart')
HUP
parseoptions()
parseoptions() method parse options given at command line and returns the value of run-mode.
help()
help() prints help message of Haineko::CLI::Daemon for command line.
Haineko::CLI - Base class of Haineko::CLI::Daemon
"haineoctl" in bin - Script of Haineko::CLI::* implementation
https://github.com/azumakuniyuki/Haineko
azumakuniyuki <perl.org [at] azumakuniyuki.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Haineko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Haineko
CPAN shell
perl -MCPAN -e shell install Haineko
For more information on module installation, please visit the detailed CPAN module installation guide.