Commit b00291bc authored by Leigh Stoller's avatar Leigh Stoller

An old problem rears its ugly head; apache does not close open file

descriptors before it execs cgi programs. This leads to a big mess if
you happen to kill a spawned process, say with a DB table locked.
Added a close loop to the top of the scripts. This whole apacge cgi
approach is pretty stinky (slow). At some point need to switch to
fastcgi or a separate server process.
parent 041b5ecb
......@@ -14,6 +14,16 @@ use strict;
use English;
use Frontier::Responder;
use Data::Dumper;
use POSIX;
# Yack. apache does not close fds before the exec, and if this dies
# we are left with a giant mess.
BEGIN {
no warnings;
for (my $i = 3; $i < 2048; $i++) {
POSIX:close($i);
}
}
# Do this early so that we talk to the right DB.
use vars qw($GENI_DBNAME);
......@@ -107,9 +117,6 @@ if (!defined($request)) {
#
LogStart(0, undef, LIBAUDIT_LOGTBOPS());
# Add stuff for log message if sent.
AddAuditInfo("message", $request . "\n");
my $responder = Frontier::Responder->new( "methods" => {
"GetCredential" => \&GeniCH::GetCredential,
"Resolve" => \&GeniCH::Resolve,
......
......@@ -14,6 +14,16 @@ use strict;
use English;
use Frontier::Responder;
use Data::Dumper;
use POSIX;
# Yack. apache does not close fds before the exec, and if this dies
# we are left with a giant mess.
BEGIN {
no warnings;
for (my $i = 3; $i < 2048; $i++) {
POSIX:close($i);
}
}
# Do this early so that we talk to the right DB.
use vars qw($GENI_DBNAME);
......@@ -111,9 +121,6 @@ LogStart(0, undef, LIBAUDIT_LOGTBOPS());
#
Genixmlrpc->SetContext(Genixmlrpc->Context($certificate));
# Add stuff for log message if sent.
AddAuditInfo("message", $request . "\n");
my $responder = Frontier::Responder->new( "methods" => {
"Resolve" => \&GeniCM::Resolve,
"DiscoverResources" => \&GeniCM::DiscoverResources,
......
......@@ -14,6 +14,16 @@ use strict;
use English;
use Frontier::Responder;
use Data::Dumper;
use POSIX;
# Yack. apache does not close fds before the exec, and if this dies
# we are left with a giant mess.
BEGIN {
no warnings;
for (my $i = 3; $i < 2048; $i++) {
POSIX:close($i);
}
}
# Do this early so that we talk to the right DB.
use vars qw($GENI_DBNAME);
......@@ -136,6 +146,3 @@ AddAuditInfo("message", $response . "\n\n" . $request);
LogEnd();
print "Content-Type: text/xml \n\n" . $response;
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