Ubic::Service::Common - common way to construct new service by specifying several callbacks
version 1.57
$service = Ubic::Service::Common->new({ start => sub { # implementation-specific }, stop => sub { # implementation-specific }, status => sub { # implementation-specific }, name => "my-service", port => 1234, }); $service->start;
Each service should provide safe start(), stop() and status() methods.
start()
stop()
status()
Construct service object.
Possible parameters:
Mandatory sub reference providing service start mechanism.
The same for stop.
Mandatory sub reference checking if service is alive.
It should return one of running, not running, broken values.
running
not running
broken
This code will be used as safety check against double start and in watchdog checks.
Service's name.
Optional, will usually be set by upper-level multiservice. Don't set it unless you know what you're doing.
User under which daemon will be started. Optional, default is root.
root
Group under which daemon will be started. Optional, default is all user groups.
Value can be scalar or arrayref.
Service's port.
Vyacheslav Matyukhin <mmcleric@yandex-team.ru>
This software is copyright (c) 2013 by Yandex LLC.
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 Ubic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ubic
CPAN shell
perl -MCPAN -e shell install Ubic
For more information on module installation, please visit the detailed CPAN module installation guide.