From da27f42c2b34526d1d3c5a57756289b277d4b0d6 Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Tue, 9 Apr 2013 14:58:08 -0600 Subject: [PATCH] Remove lib/meta/* in start_services(). --- bin/pt-agent | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/pt-agent b/bin/pt-agent index abc38912..ce2359bc 100755 --- a/bin/pt-agent +++ b/bin/pt-agent @@ -5773,6 +5773,17 @@ sub start_services { my $env_vars = env_vars(); + # Remove old meta files. + my $meta_files = "$lib_dir/meta/*"; + foreach my $meta_file ( glob $meta_files ) { + if ( unlink $meta_file ) { + _info("Removed $meta_file"); + } + else { + _warn("Cannot remove $meta_file: $OS_ERROR"); + } + } + SERVICE: foreach my $service ( @$services ) { next unless $service->run_once; @@ -5799,17 +5810,7 @@ sub start_services { unlink $start_log or _warn("Cannot remove $start_log: $OS_ERROR"); - # Remove the service's previous meta files. - foreach my $meta_file (glob("$lib_dir/meta/" . $service->name . "*")) { - if ( unlink $meta_file ) { - _info("Removed $meta_file"); - } - else { - _warn("Cannot remove $meta_file: $OS_ERROR"); - } - } - - _info($service->name, ' has started'); + _info($service->name . ' has started'); } return;