From 496ca7d00c2df3f19703ae79db40a2bb5a496a22 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 25 Sep 2008 02:59:43 +0000 Subject: [PATCH] added a configurable startup pause delay. after opensrf.settings has been started (which will always be the first service to start), pause the top-level process for the configured amount of time before starting any more services git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1439 9efc2488-bf62-4759-914b-345cdb29e865 --- bin/opensrf-perl.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/opensrf-perl.pl b/bin/opensrf-perl.pl index f120e31..628c5b8 100755 --- a/bin/opensrf-perl.pl +++ b/bin/opensrf-perl.pl @@ -30,6 +30,7 @@ my $opt_service = undef; my $opt_config = undef; my $opt_pid_dir = '/tmp'; my $opt_no_daemon = 0; +my $opt_settings_pause = 0; my $opt_help = 0; my $sclient; my $hostname = hostfqdn(); @@ -41,6 +42,7 @@ GetOptions( 'config=s' => \$opt_config, 'pid-dir=s' => \$opt_pid_dir, 'no-daemon' => \$opt_no_daemon, + 'settings-startup-pause=i' => \$opt_settings_pause, 'help' => \$opt_help, ); @@ -119,7 +121,12 @@ sub do_start { } sub do_start_all { - do_start('opensrf.settings') if grep {$_ eq 'opensrf.settings'} @hosted_services; + if(grep {$_ eq 'opensrf.settings'} @hosted_services) { + do_start('opensrf.settings'); + # in batch mode, give opensrf.settings plenty of time to start + # before any non-Perl services try to connect + sleep $opt_settings_pause if $opt_settings_pause; + } for my $service (@hosted_services) { do_start($service) unless $service eq 'opensrf.settings'; } @@ -205,6 +212,12 @@ sub do_help { --no-daemon Do not detach and run as a daemon process. Useful for debugging. + + --settings-startup-pause + How long to give the opensrf.settings server to start up when running + in batch mode (start_all). The purpose is to give plenty of time for + the settings server to be up and active before any non-Perl services + attempt to connect. --help Print this help message -- 2.43.2