Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item6042: make FastCGI engine restart itself automatically if SIGHUP …
…recieved or on configuration update git-svn-id: http://svn.foswiki.org/trunk/FastCGIEngineContrib@1573 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
GilmarSantosJr
authored and
GilmarSantosJr
committed
Dec 24, 2008
1 parent
4dca82a
commit 942e968
Showing
4 changed files
with
144 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
FastCGIEngineContrib/lib/Foswiki/Contrib/FastCGIEngineContrib/MANIFEST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
bin/foswiki.fcgi 0755 | ||
lib/Foswiki/Engine/FastCGI.pm 0644 | ||
lib/Foswiki/Engine/FastCGI/ProcManager.pm 0644 | ||
data/System/FastCGIEngineContrib.txt 0644 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
FastCGIEngineContrib/lib/Foswiki/Engine/FastCGI/ProcManager.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# FastCGI Runtime Engine Component of Foswiki - The Free and Open Source Wiki, | ||
# http://foswiki.org/ | ||
# | ||
# Copyright (C) 2008 Gilmar Santos Jr, jgasjr@gmail.com and Foswiki | ||
# contributors. Foswiki contributors are listed in the AUTHORS file in the root | ||
# of Foswiki distribution. | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. For | ||
# more details read LICENSE in the root of this distribution. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
# | ||
# As per the GPL, removal of this notice is prohibited. | ||
|
||
=begin TML | ||
---+!! UNPUBLISHED package Foswiki::Engine::FastCGI::ProcManager | ||
Wrapper around FastCGI::ProcManager to make FastCGI engine re-execute itself | ||
automatically upon configuration change. | ||
=cut | ||
|
||
package Foswiki::Engine::FastCGI::ProcManager; | ||
|
||
use base 'FCGI::ProcManager'; | ||
use strict; | ||
|
||
sub sig_manager { | ||
my $this = shift; | ||
$this->SUPER::sig_manager(@_); | ||
$Foswiki::Engine::FastCGI::hupRecieved++; | ||
$this->n_processes(0); | ||
} | ||
|
||
sub pm_die { | ||
my $this = shift; | ||
if ( $Foswiki::Engine::FastCGI::hupRecieved ) { | ||
Foswiki::Engine::FastCGI::reExec(); | ||
} | ||
else { | ||
$this->SUPER::pm_die(@_); | ||
} | ||
} | ||
|
||
1; |