Commit 5c6e3307 authored by Xavier Guimard's avatar Xavier Guimard

Better debug for FastCGI (#1369)

parent ab973c47
...@@ -10,10 +10,9 @@ use Lemonldap::NG::Handler::Main::Reload; ...@@ -10,10 +10,9 @@ use Lemonldap::NG::Handler::Main::Reload;
our $VERSION = '2.0.0'; our $VERSION = '2.0.0';
our ( our (
$foreground, $engine, $nproc, $foreground, $engine, $nproc, $pidFile,
$pidFile, $socket, $user, $socket, $user, $listen, $group,
$listen, $group, $customFunctionsFile, $customFunctionsFile, %plackOptions
%plackOptions
); );
my %_apps; my %_apps;
...@@ -92,6 +91,9 @@ my %builder = ( ...@@ -92,6 +91,9 @@ my %builder = (
my $script = $_[0]->{SCRIPT_FILENAME}; my $script = $_[0]->{SCRIPT_FILENAME};
return $_apps{$script}->(@_) if ( $_apps{$script} ); return $_apps{$script}->(@_) if ( $_apps{$script} );
$_apps{$script} = do $script; $_apps{$script} = do $script;
unless ( $_apps{$script} and ref $_apps{$script} ) {
die "Unable to load $_[0]->{SCRIPT_FILENAME}";
}
return $_apps{$script}->(@_); return $_apps{$script}->(@_);
} }
}, },
...@@ -118,12 +120,12 @@ Lemonldap::NG::Handler::Main->onReload( ...@@ -118,12 +120,12 @@ Lemonldap::NG::Handler::Main->onReload(
my $server = Plack::Runner->new(); my $server = Plack::Runner->new();
$server->parse_options( $server->parse_options(
'-s' => $engine, '-s' => $engine,
'-E' => 'deployment', '-E' => 'deployment',
'--pid' => $pidFile, '--pid' => $pidFile,
'--nproc' => $nproc, '--nproc' => $nproc,
'--socket' => $socket, '--socket' => $socket,
( $listen ? ('--listen', $listen) : ()), ( $listen ? ( '--listen', $listen ) : () ),
'--proc-title' => 'llng-fastcgi-server', '--proc-title' => 'llng-fastcgi-server',
( $foreground ? () : '--daemonize' ), ( $foreground ? () : '--daemonize' ),
'--no-default-middleware', '--no-default-middleware',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment