From 6df9e469b1911022daeca8294154dd4239977561 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 6 Dec 2014 04:22:07 +0100 Subject: 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. --- app.psgi | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 app.psgi 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"; -- cgit v1.2.3-1-g7c22