From 2b4934e32ee5f9bd2f79f867304e7e0c0c7af8ee Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 6 Feb 2015 15:09:10 +0000 Subject: [PATCH] teach osrf_control --diagnostic about --service Signed-off-by: Galen Charlton --- bin/opensrf-perl.pl.in | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in index e1c7efc..a169070 100755 --- a/bin/opensrf-perl.pl.in +++ b/bin/opensrf-perl.pl.in @@ -223,14 +223,23 @@ sub get_service_pids_from_ps { sub do_diagnostic { + my $service = shift; my $alive = do_init(1); - my @services = get_service_list_from_files(1); my @conf_services; if ($alive) { @conf_services = (@perl_services, map {$_->{service}} @nonperl_services); - push(@services, @conf_services); + } + + my @services; + if ($service) { + @services = $service; + } else { + @services = get_service_list_from_files(1); + if ($alive) { + push(@services, @conf_services); + } } my %services; @@ -790,7 +799,7 @@ do_signal_all($opt_signal) if $opt_router_re_register_all; # misc -do_diagnostic() if $opt_diagnostic; +do_diagnostic($opt_service) if $opt_diagnostic; # show help if no action was requested -- 2.11.0