
Ubic::Service::Plack - Helper for running psgi applications with ubic and plackup

version 1.15

use Ubic::Service::Plack;
return Ubic::Service::Plack->new({
server => "FCGI",
server_args => { listen => "/tmp/app.sock",
nproc => 5 },
app => "/var/www/app.psgi",
status => sub { ... },
port => 4444,
ubic_log => '/var/log/app/ubic.log',
stdout => '/var/log/app/stdout.log',
stderr => '/var/log/app/stderr.log',
user => "www-data",
});

This service is a common ubic wrap for psgi applications. It uses plackup for running these applications.

Ubic::Service::Plack - ubic service base class for psgi applications

version 1.15

new($params)Parameters (optional if not specified otherwise):
Path to .psgi app.
Server name from Plack::Server::* or Plack::Handler::* namespace. You can pass this param in both variants, for example 'Plack::Handler::FCGI' or just 'FCGI'.
Hashref with options that will be passed to concrete Plack server specified by server param. See concrete server docimentation for possible options. You can also pass here such options as 'env' to override defaults.
Coderef to special function, that will check status of your application.
Port on which your application works. ubic.ping will use this info for HTTP status checking of your application.
Path to ubic log.
Path to stdout log of plackup.
Path to stderr log of plackup.
User under which plackup will be started.
Group under which plackup will be started. Default is all user groups.
Change working directory before starting a daemon.
Modify environment before starting a daemon. Must be a plain hashref if specified.
Pidfile for Ubic::Daemon module.
If not specified, it will be derived from service's name or from app_name, if provided.
Pidfile is:
/tmp/APP_NAME.pid, where APP_NAME is app_name option value, if it's provided;/tmp/SERVICE_NAME.pid, where SERVICE_NAME is service's full name.Name of your application. DEPRECATED.
It was used in older releases for constructing the path for storing pid-file of your app.
pidfile()Get pidfile name.
bin()Get command-line with all arguments in the arrayref form.

Some kind of basic HTTP/socket (depending on server type) ping in status phase would be handy.


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.