Skip to content

Commit

Permalink
Item13010: make LocalSite.cfg checks optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Jan 14, 2015
1 parent 1e64875 commit 9d9a8b0
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 33 deletions.
4 changes: 2 additions & 2 deletions bin/foswiki.fcgi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env perl
#!/usr/bin/perl
# Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2008-2014 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki
# Copyright (C) 2008-2015 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki
# contributors. Foswiki contributors are listed in the AUTHORS file in the root
# of Foswiki distribution.
#
Expand Down
5 changes: 3 additions & 2 deletions data/System/FastCGIEngineContrib.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="autosave" date="1356278771" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1421231224" format="1.1" version="1"}%
---+!! <nop>FastCGI Engine Contrib
%$SHORTDESCRIPTION%

Expand Down Expand Up @@ -396,11 +396,12 @@ Dynamic servers are more useful when Foswiki access load on the server is low an
---++ Info

| Author(s) | [[Foswiki:Main.GilmarSantosJr][Gilmar Santos Jr]] |
| Copyright | &copy; 2008-2014 Gilmar Santos Jr and Foswiki Contributors |
| Copyright | &copy; 2008-2015 Gilmar Santos Jr and Foswiki Contributors |
| License: | [[http://www.gnu.org/copyleft/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | |
| 14 Jan 2015 | (1.00) Foswikitask:Item13010 - make checking =LocalSite.cfg= for changes optional so that it can be disabled for improved stability on high traffic sites |
| 29 Aug 2014 | (0.97) Foswikitask:Item13010 - fixed instability running under FCGI::ProcManager |
| 20 Feb 2014 | (0.96) Foswikitask:Item12755 - fixed socket not being closed properly on a reExec; work around error in FCGI.pm; added =quiet= parameter to suppress normal messages; fixed tainted pid filename; |
| 08 Sep 2011 | (0.95) Foswikitask:Item9957 - remove uninitialised value log message |
Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Contrib/FastCGIEngineContrib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package Foswiki::Contrib::FastCGIEngineContrib;
use strict;
use warnings;

our $VERSION = '0.97';
our $RELEASE = '0.97';
our $VERSION = '1.00';
our $RELEASE = '1.00';
our $SHORTDESCRIPTION = 'Permits Foswiki to be executed with FastCGI';

1;
7 changes: 7 additions & 0 deletions lib/Foswiki/Contrib/FastCGIEngineContrib/Config.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ $Foswiki::cfg{FastCGIContrib}{MaxSize} = 0;
# size control of child processes; high values may give you a slightly better overall performance.
$Foswiki::cfg{FastCGIContrib}{CheckSize} = 10;

# **BOOLEAN**
# Switch on/off checking LocalSite.cfg for changes. Note that you might want to disable this check on sites with
# a lot of traffic for stability reasons. Instead you'll then have to restart the Foswiki fcgi backend manually as
# required for any configuration change to LocalSite.cfg to take effect.
$Foswiki::cfg{FastCGIContrib}{CheckLocalSiteCfg} = 1;

1;
27 changes: 6 additions & 21 deletions lib/Foswiki/Contrib/FastCGIEngineContrib/build.pl
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
#!/usr/bin/perl -w
BEGIN { unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); }
use Foswiki::Contrib::Build;

# Create the build object
$build = new Foswiki::Contrib::Build('FastCGIEngineContrib');

# (Optional) Set the details of the repository for uploads.
# This can be any web on any accessible Foswiki installation.
# These defaults will be used when expanding tokens in .txt
# files, but be warned, they can be overridden at upload time!
#!/usr/bin/env perl

# name of web to upload to
$build->{UPLOADTARGETWEB} = 'Extensions/Testing';
use strict;
use warnings;

# Full URL of pub directory
$build->{UPLOADTARGETPUB} = 'http://foswiki.org/pub';

# Full URL of bin directory
$build->{UPLOADTARGETSCRIPT} = 'http://foswiki.org/bin';
BEGIN { unshift @INC, split( /:/, $ENV{FOSWIKI_LIBS} ); }

# Script extension
$build->{UPLOADTARGETSUFFIX} = '';
use Foswiki::Contrib::Build;

# Build the target on the command line, or the default target
my $build = new Foswiki::Contrib::Build('FastCGIEngineContrib');
$build->build( $build->{target} );
11 changes: 7 additions & 4 deletions lib/Foswiki/Engine/FastCGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ Refer to Foswiki::Engine documentation for explanation about methos below.

package Foswiki::Engine::FastCGI;

use strict;
use warnings;

use Foswiki::Sandbox ();
use Foswiki::Engine::CGI;
our @ISA = qw( Foswiki::Engine::CGI );

use strict;

use FCGI;
use POSIX qw(:signal_h);
require File::Spec;
Expand Down Expand Up @@ -116,7 +117,9 @@ sub run {
$this->daemonize() if $args->{detach};
}

my $localSiteCfg = $INC{'LocalSite.cfg'};
my $localSiteCfg;
$localSiteCfg = $INC{'LocalSite.cfg'} if $Foswiki::cfg{FastCGIContrib}{CheckLocalSiteCfg};

my $lastMTime = 0;
$lastMTime = ( stat $localSiteCfg )[9] if defined $localSiteCfg;

Expand Down Expand Up @@ -244,7 +247,7 @@ __END__
FastCGI Runtime Engine of Foswiki - The Free and Open Source Wiki,
http://foswiki.org/
Copyright (C) 2008-2014 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki
Copyright (C) 2008-2015 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki
contributors. Foswiki contributors are listed in the AUTHORS file in the root
of Foswiki distribution.
Expand Down
6 changes: 4 additions & 2 deletions lib/Foswiki/Engine/FastCGI/ProcManager.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# FastCGI Runtime Engine Component of Foswiki - The Free and Open Source Wiki,
# http://foswiki.org/
#
# Copyright (C) 2008-2014 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki
# Copyright (C) 2008-2015 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki
# contributors. Foswiki contributors are listed in the AUTHORS file in the root
# of Foswiki distribution.
#
Expand All @@ -28,10 +28,12 @@ automatically upon configuration change.

package Foswiki::Engine::FastCGI::ProcManager;

use strict;
use warnings;

use FCGI::ProcManager::Constrained;
use Foswiki::Engine::FastCGI ();
our @ISA = qw( FCGI::ProcManager::Constrained );
use strict;

sub sig_manager {
my $this = shift;
Expand Down

0 comments on commit 9d9a8b0

Please sign in to comment.