Skip to content
Permalink
Browse files

Do not declare services to be down unless they're actually down.

  • Loading branch information...
perlDreamer committed Jan 7, 2012
1 parent 23d3f79 commit e952ac98b86570551dbdadd0e541071248d7390d
Showing with 6 additions and 2 deletions.
  1. +6 −2 wre/lib/WRE/Mysql.pm
@@ -209,7 +209,6 @@ sub start {
my $count = 0;
my $success = 0;
my $config = $self->wreConfig;
$config->set("wreMonitor/mysqlAdministrativelyDown", 0);
my $host = WRE::Host->new(wreConfig => $config);
my $cmd = "mysql.server start --user=".$config->get("user");
`$cmd`; # catch command line output
@@ -218,6 +217,9 @@ sub start {
eval {$success = $self->ping };
$count++;
}
if ($success) {
$config->set("wreMonitor/mysqlAdministrativelyDown", 0);
}
return $success;
}

@@ -236,7 +238,6 @@ sub stop {
my $count = 0;
my $success = 1;
my $config = $self->wreConfig;
$config->set("wreMonitor/mysqlAdministrativelyDown", 1);
my $host = WRE::Host->new(wreConfig => $config);
my $cmd = "mysql.server stop";
`$cmd`; # catch command line output
@@ -245,6 +246,9 @@ sub stop {
eval {$success = $self->ping };
$count++;
}
if (!$success) {
$config->set("wreMonitor/mysqlAdministrativelyDown", 1);
}
return !$success;
}

0 comments on commit e952ac9

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