teach osrf_control --diagnostic about --service
authorGalen Charlton <gmc@esilibrary.com>
Fri, 6 Feb 2015 15:09:10 +0000 (15:09 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 6 Feb 2015 15:09:10 +0000 (15:09 +0000)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bin/opensrf-perl.pl.in

index e1c7efc..a169070 100755 (executable)
@@ -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