summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2014-12-06 04:22:07 +0100
committerAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2014-12-06 04:22:07 +0100
commit6df9e469b1911022daeca8294154dd4239977561 (patch)
treecce46a0fffe4c797ca14669a2a6de0c966594b67
parent18bf6acced754c98697008dca3463360e660e3ba (diff)
downloadcustom-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-xapp.psgi22
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";