Ubic::Service::SimpleDaemon - declarative service for daemonizing any binary
version 1.36_01
use Ubic::Service::SimpleDaemon; my $service = Ubic::Service::SimpleDaemon->new( bin => "sleep 1000", stdout => "/var/log/sleep.log", stderr => "/var/log/sleep.err.log", ubic_log => "/var/log/sleep.ubic.log", user => "nobody", );
Use this class to daemonize any binary.
This module uses Ubic::Daemon module for process daemonization. All pidfiles are stored in ubic data dir, with their names based on service names.
Constructor.
Parameters:
Daemon binary.
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.
File into which daemon's stdout will be redirected. Default is /dev/null.
/dev/null
File into which daemon's stderr will be redirected. Default is /dev/null.
Optional filename of ubic log. Log will contain some technical information about running daemon.
Change working directory before starting a daemon. Optional.
Modify environment before starting a daemon. Optional. Must be a plain hashref if specified.
Service's name.
Optional, will usually be set by upper-level multiservice. Don't set it unless you know what you're doing.
Get pid filename. It will be concatenated from simple-daemon pid dir and service's name.
Ubic::Daemon - module to daemonize any binary
Vyacheslav Matyukhin <mmcleric@yandex-team.ru>
This software is copyright (c) 2012 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.