Module::Build::Service::Fork - Role for process handling in service implementations
version 0.91
package Module::Build::Service::foo; use Moo; extends 'Module::Build::Service::Base'; with 'Module::Build::Service::Fork'; sub _build_command { my ($self) = @_; [$self->bin, qw{-f flag1 -g flag2 -h}]; } sub _build_log { ',,foo.log' } sub _build_executable { 'foo' }
This is a role that tries to factor out a lot of boilerplate in defining services that involve forking an executable to run the service.
The full path to the binary executable for starting the service.
If this is not specified, we search for executable in path.
The command-line for the executable. Each class including the role must define it, as there is no sensible default.
The bare name of the executable that is run to start the service. Defaults to service_name.
service_name
If you specify bin directly (either in a parameter to new, or by overriding _build_bin), you don't actually need to specify this unless you use it yourself, as it is only used when trying to generate bin automatically.
bin
new
The list of directories in which we should search for the executable. The default is /usr/sbin and /usr/local/sbin.
/usr/sbin
/usr/local/sbin
A default implementation of start_service that starts the contents of command.
start_service
command
A default implementation of stop_service that just terminates the child process. Generally adequate. It can be overridden or modified as appropriate.
stop_service
Michael Alan Dorman <mdorman@ironicdesign.com>
This software is copyright (c) 2012 by Ironic Design, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Module::Build::Service, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Build::Service
CPAN shell
perl -MCPAN -e shell install Module::Build::Service
For more information on module installation, please visit the detailed CPAN module installation guide.