From 81cdb6f841b0adfcf1b621a49b2120cc2a5a5752 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 31 Jan 2014 15:50:01 -0500 Subject: [PATCH] LP#1286198: Offer ability to ignore what seem like orphan processes when starting things Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Mike Rylander Signed-off-by: Galen Charlton --- bin/opensrf-perl.pl.in | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in index a939efe..c95e2b3 100755 --- a/bin/opensrf-perl.pl.in +++ b/bin/opensrf-perl.pl.in @@ -61,6 +61,7 @@ my $opt_reload = 0; my $opt_reload_all = 0; my $opt_quiet = 0; my $opt_diagnostic = 0; +my $opt_ignore_orphans = 0; my $sclient; my @perl_services; my @nonperl_services; @@ -101,7 +102,8 @@ GetOptions( 'router-re-register-all' => \$opt_router_re_register_all, 'reload' => \$opt_reload, 'reload-all' => \$opt_reload_all, - 'diagnostic' => \$opt_diagnostic + 'diagnostic' => \$opt_diagnostic, + 'are-there-no-prisons' => \$opt_ignore_orphans ); if ($opt_localhost) { @@ -369,7 +371,7 @@ sub do_start { unlink $pidfile; } - } elsif (@ps_pids) { # orphan process + } elsif (@ps_pids and not $opt_ignore_orphans) { # orphan process if ($opt_force_clean_process) { msg("service $service pid=@ps_pids is running with no pidfile"); @@ -666,7 +668,12 @@ sub do_help { --force-clean-process When starting a service, if a service process is already running but no pidfile exists, kill the service process before starting - the new one. + the new one. This applies to routers too. + + --are-there-no-prisons + When starting a service, if a service procses is already running but + no pidfile exists, ignore the existing process and carry on starting + the new one (i.e., ignore orphans). This applies to routers too. ==== stopping services ===== -- 2.43.2