Skip to content
Permalink
Browse files

Force a known good location for spectre pid files to be written.

  • Loading branch information...
perlDreamer committed Feb 16, 2012
1 parent 11028b8 commit fc31c5c4fb01dd6c0e61cb965bcb94fcb6bdc897
Showing with 15 additions and 3 deletions.
  1. +15 −3 wre/sbin/wresetup.pl
@@ -52,9 +52,21 @@
$config->getRoot("/etc/wre.logrotate"),
{ force => 1, processTemplate => 1, });

say "Setting up Spectre config";
$file->copy($config->getWebguiRoot("/etc/spectre.conf.original"), $config->getWebguiRoot("/etc/spectre.conf"),
{ force => 1 });
say "Setting up Spectre configuration";
eval {
open my $in, '<', $config->getWebguiRoot("/etc/spectre.conf.original")
or die "Unable to open '" . $config->getWebguiRoot("/etc/spectre.conf.original") . "': $!\n";
open my $out, '>', $config->getWebguiRoot("/etc/spectre.conf")
or die "Unable to open '" . $config->getWebguiRoot("/etc/spectre.conf") . "': $!\n";
while (my $line = <$in>) {
$line =~ s{/var/run/spectre\.pid}{ $config->getRoot("/var/run/spectre.pid") }ge;
print {$out} $line;
}
close $out;
close $in;
};

say "Fixing permissions on the WebGUI etc directory";
$file->changeOwner($config->getWebguiRoot("/etc"));

say "Setting up WebGUI logging";

0 comments on commit fc31c5c

Please sign in to comment.
You can’t perform that action at this time.