mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Fix --stop to look for stop-<service> instead of disable-<service>.
This commit is contained in:
+6
-5
@@ -6649,8 +6649,8 @@ sub stop_agent {
|
|||||||
: "$FindBin::Bin/";
|
: "$FindBin::Bin/";
|
||||||
|
|
||||||
if ( !-f $pid_file ) {
|
if ( !-f $pid_file ) {
|
||||||
_warn("PID file $pid_file does not exist; you must stop "
|
_info("PID file $pid_file does not exist; if pt-agent is running, "
|
||||||
. "pt-agent manually");
|
. "use kill -ABRT to force it to stop.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
chop(my $pid = slurp($pid_file));
|
chop(my $pid = slurp($pid_file));
|
||||||
@@ -6709,21 +6709,22 @@ sub stop_agent {
|
|||||||
if ( -d "$lib_dir/services" ) {
|
if ( -d "$lib_dir/services" ) {
|
||||||
my $env_vars = env_vars();
|
my $env_vars = env_vars();
|
||||||
|
|
||||||
_info("Disabling all services (clean up)...");
|
_info("Stopping all services...");
|
||||||
SERVICE:
|
SERVICE:
|
||||||
foreach my $file ( glob "$lib_dir/services/disable-*" ) {
|
foreach my $file ( glob "$lib_dir/services/stop-*" ) {
|
||||||
my $service = basename($file);
|
my $service = basename($file);
|
||||||
my $disable_log = "$lib_dir/logs/$service.stop";
|
my $disable_log = "$lib_dir/logs/$service.stop";
|
||||||
my $cmd = ($env_vars ? "$env_vars " : '')
|
my $cmd = ($env_vars ? "$env_vars " : '')
|
||||||
. "${bin_dir}pt-agent --run-service $service"
|
. "${bin_dir}pt-agent --run-service $service"
|
||||||
. " </dev/null"
|
. " </dev/null"
|
||||||
. " >$disable_log 2>&1";
|
. " >$disable_log 2>&1";
|
||||||
|
_info("Running $cmd");
|
||||||
PTDEBUG && _d($cmd);
|
PTDEBUG && _d($cmd);
|
||||||
system($cmd);
|
system($cmd);
|
||||||
my $cmd_exit_status = $CHILD_ERROR >> 8;
|
my $cmd_exit_status = $CHILD_ERROR >> 8;
|
||||||
if ( $cmd_exit_status != 0 ) {
|
if ( $cmd_exit_status != 0 ) {
|
||||||
my $err = slurp($disable_log);
|
my $err = slurp($disable_log);
|
||||||
_warn("Error running $service: " . ($err || ''));
|
_warn("Error stopping $service: " . ($err || ''));
|
||||||
next SERVICE;
|
next SERVICE;
|
||||||
}
|
}
|
||||||
unlink $disable_log
|
unlink $disable_log
|
||||||
|
|||||||
Reference in New Issue
Block a user