Skip to content

Commit

Permalink
Force a known good location for spectre pid files to be written.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Feb 16, 2012
1 parent 11028b8 commit fc31c5c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions wre/sbin/wresetup.pl
Expand Up @@ -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";
Expand Down

0 comments on commit fc31c5c

Please sign in to comment.