diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-12-06 04:22:07 +0100 |
---|---|---|
committer | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2014-12-06 04:22:07 +0100 |
commit | 6df9e469b1911022daeca8294154dd4239977561 (patch) | |
tree | cce46a0fffe4c797ca14669a2a6de0c966594b67 | |
parent | 18bf6acced754c98697008dca3463360e660e3ba (diff) | |
download | custom-6df9e469b1911022daeca8294154dd4239977561.tar.gz custom-6df9e469b1911022daeca8294154dd4239977561.tar.bz2 custom-6df9e469b1911022daeca8294154dd4239977561.zip |
app.psgi: add wrapper for bin/cgi-bin/app.psgi
We want a custom wrapper for $SIG{__DIE__} because the automatic
wrapper from uwsgi does not handle the $^S case and some perl libs
fails (f.e. Net::SSLeay). This is only a thin wrapper with the
signal handler and some magic to fix FindBin for the original script.
-rwxr-xr-x | app.psgi | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app.psgi b/app.psgi new file mode 100755 index 0000000..f16dfce --- /dev/null +++ b/app.psgi @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use FindBin qw($Bin); +use Devel::StackTrace; + +BEGIN { + $SIG{__DIE__} = sub { + return if $^S; + + my $error = shift; + my $trace = Devel::StackTrace->new; + print STDERR "\nError: $error", + "Stack Trace:\n", + $trace->as_string, "\n"; + }; +} + +$Bin = "$Bin/../bin/cgi-bin"; +do "$Bin/app.psgi"; |