LP1930578: Really Stop Single Services
authorJason Boyer <JBoyer@EquinoxInitiative.org>
Wed, 2 Jun 2021 13:43:12 +0000 (09:43 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 2 Dec 2021 21:14:07 +0000 (16:14 -0500)
Use the same timeout / escalation method for single services as is
used for all services. Punted on any real refactoring for now.

Signed-off-by: Jason Boyer <JBoyer@equinoxOLI.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
bin/opensrf-perl.pl.in

index 40015e3..3c3e8d7 100755 (executable)
@@ -449,7 +449,12 @@ sub do_start_services {
 sub do_signal {
     my $service = shift;
     my $signal = shift;
-    return do_signal_all($signal, $service);
+    do_signal_send($service, $signal);
+
+    # if user passed a know non-shutdown signal, we're done.
+    return 1 if $signal =~ /HUP|USR1|USR2/;
+
+    return do_signal_wait($service);
 }
 
 # returns the list of running services based on presence of PID files.