Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@brmss-noc:~# vi /omd/sites/entsf/lib/perl5/lib/perl5/Catalyst/ScriptRunner.pm
- package Catalyst::ScriptRunner;
- use Moose;
- use FindBin;
- use lib;
- use File::Spec;
- use namespace::autoclean;
- sub run {
- my ($self, $class, $scriptclass) = @_;
- my $classtoload = "${class}::Script::$scriptclass";
- lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
- unless ( eval { Class::MOP::load_class($classtoload) } ) {
- warn("Could not load $classtoload - falling back to Catalyst::Script::$scriptclass : $@\n")
- if $@ !~ /Can't locate/;
- $classtoload = "Catalyst::Script::$scriptclass";
- Class::MOP::load_class($classtoload);
- }
- $classtoload->new_with_options( application_name => $class )->run;
- }
- __PACKAGE__->meta->make_immutable;
- =head1 NAME
- Catalyst::ScriptRunner - The Catalyst Framework script runner
- =head1 SYNOPSIS
- # Will run MyApp::Script::Server if it exists, otherwise
- # will run Catalyst::Script::Server.
- Catalyst::ScriptRunner->run('MyApp', 'Server');
- =head1 DESCRIPTION
- This class is responsible for running scripts, either in the application specific namespace
- (e.g. C<MyApp::Script::Server>), or the Catalyst namespace (e.g. C<Catalyst::Script::Server>)
- =head1 METHODS
- =head2 run ($application_class, $scriptclass)
- Called with two parameters, the application classs (e.g. MyApp)
- and the script class, (i.e. one of Server/FastCGI/CGI/Create/Test)
- =head1 AUTHORS
- Catalyst Contributors, see Catalyst.pm
- =head1 COPYRIGHT
- This library is free software. You can redistribute it and/or modify it under
- the same terms as Perl itself.
- =cut
- ----------------------------------------------------------------------------------------------
- root@brmss-noc:~# vi /omd/sites/entsf/share/thruk/script/thruk_fastcgi.pl
- use Config;
- if(-e $FindBin::Bin."/../local-lib") {
- ### use 5.10.0; # only required for packages ###
- use lib $FindBin::Bin."/../local-lib/lib/perl5";
- if(! -e $FindBin::Bin."/../local-lib/lib/perl5/".$Config{archname}) {
- die("\nERROR: this is the wrong precompiled version, your archname is: ".$Config{archname}."\n\n");
- }
- require local::lib; local::lib->import($FindBin::Bin."/../local-lib/perl5/");
- }
- }
- use Catalyst::ScriptRunner;
- Catalyst::ScriptRunner->run('Thruk', 'FastCGI');
- 1;
- =head1 NAME
- thruk_fastcgi.pl - Catalyst FastCGI
- =head1 SYNOPSIS
- thruk_fastcgi.pl [options]
- Options:
- -? -help display this help and exits
- -l --listen Socket path to listen on
- (defaults to standard input)
- can be HOST:PORT, :PORT or a
- filesystem path
- -n --nproc specify number of processes to keep
- to serve requests (defaults to 1,
- requires -listen)
- -p --pidfile specify filename for pid file
- (requires -listen)
- -d --daemon daemonize (requires -listen)
- -M --manager specify alternate process manager
- (FCGI::ProcManager sub-class)
- or empty string to disable
- -e --keeperr send error messages to STDOUT, not
- to the webserver
- =head1 DESCRIPTION
- Run a Catalyst application as fastcgi.
- =head1 AUTHORS
- Catalyst Contributors, see Catalyst.pm
- =head1 COPYRIGHT
- This library is free software. You can redistribute it and/or modify
- it under the same terms as Perl itself.
- =cut
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement