Ubic::Service::Toadfarm - Ubic Toadfarm service class
This class require Ubic which is not automatically installed by Toadfarm.
Put the code below in a ubic service file:
ubic
use Ubic::Service::Toadfarm; Ubic::Service::Toadfarm->new( log => { file => '/path/to/log/file', # required combined => 1, }, # toadfarm config args secret => 'super secret', apps => [...], plugins => [...], );
pid_file
This file is created automatically. It will be stored in the "tmp" directory in your "ubic" data directory. This means that you do not have to specify the pid_file in the "hypnotoad" config section.
MOJO_CONFIG
The Toadfarm application will be started with a config file generated by this service class. The config file will be stored in the "tmp" directory in your "ubic" data directory.
It is possible to use this module as a generic hypnotoad starter, instead of Ubic::Service::Hypnotoad, by setting the "HYPNOTOAD_APP" environment variable:
hypnotoad
use Ubic::Service::Toadfarm; Ubic::Service::Toadfarm->new( env => { HYPNOTOAD_APP => '/path/to/my-mojo-app', }, );
See "SYNOPSIS".
This is called when you run ubic start. It will start toadfarm using hypnotoad after writing the toadfarm config and settings MOJO_CONFIG.
ubic start
The config will be written to the "tmp" directory in ubic's data directory.
This method will issue a HTTP "HEAD /ubic-status" request to the server. The response is not important, the important thing is that the server responds.
This method will kill the server pid found in "pid_file" with "TERM".
This method will reload the server pid found in "pid_file" with "USR2".
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Toadfarm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Toadfarm
CPAN shell
perl -MCPAN -e shell install Toadfarm
For more information on module installation, please visit the detailed CPAN module installation guide.