Skip to content

Commit

Permalink
Item13253: Tell user when server reload required
Browse files Browse the repository at this point in the history
Mod_perl always needs a reload.  fcgi needs the backends killed unless
configured to detect configuration change.  (whihc has its own issues)
  • Loading branch information
gac410 committed Mar 30, 2015
1 parent 4e4d317 commit 279c3ba
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions core/lib/Foswiki/Configure/Wizards/Save.pm
Expand Up @@ -131,6 +131,10 @@ Returns a wizard report.
sub save {
my ( $this, $reporter ) = @_;

# Stash the Engine & Bootstrapping We don't save it, but need to refer to it later.
my $engine = $Foswiki::cfg{Engine};
my $isBootstrap = $Foswiki::cfg{isBOOTSTRAPPING};

my $logger;
if ($Foswiki::Plugins::SESSION) {
$logger = $Foswiki::Plugins::SESSION->logger;
Expand Down Expand Up @@ -201,8 +205,10 @@ sub save {

my %save;

# Clear out the configuration and re-initialize it either
# with or without the .spec expansion.
# Clear out the configuration and re-initialize it either
# with or without the .spec expansion. This also clears the {Engine} and {isBOOTSTRAPPING}
# settings, but they should not be saved to the file, so that's desired behavior. This
# also prevents any other config settings from being modified by checkers or other code.
if ( $Foswiki::cfg{isBOOTSTRAPPING} ) {
foreach my $key ( @{ $Foswiki::cfg{BOOTSTRAP} } ) {
eval("(\$save$key)=\$Foswiki::cfg$key=~m/^(.*)\$/");
Expand Down Expand Up @@ -313,6 +319,26 @@ sub save {
}
$reporter->NOTE("New configuration saved in $lsc");

if ( $engine =~ m/^Foswiki::Engine::Apache2?::MP/ ) {
$reporter->WARN(
'Web server reload required after updating the configuration.');
}
elsif (
$engine eq 'Foswiki::Engine::FastCGI'
&& (
(
defined $Foswiki::cfg{FastCGIContrib}{CheckLocalSiteCfg}
&& !$Foswiki::cfg{FastCGIContrib}{CheckLocalSiteCfg}
)
|| $isBootstrap
)
)
{
$reporter->WARN(
"Restart of the foswiki fcgi backend is required after updating the configuration."
);
}

if (%orig_content) {
$reporter->NOTE('| *Key* | *Old* | *New* |');
_compareConfigs( $root, \%orig_content, \%Foswiki::cfg,
Expand Down

0 comments on commit 279c3ba

Please sign in to comment.