[Opensrf-commits] r1439 - trunk/bin

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Sep 24 22:59:45 EDT 2008


Author: erickson
Date: 2008-09-24 22:59:43 -0400 (Wed, 24 Sep 2008)
New Revision: 1439

Modified:
   trunk/bin/opensrf-perl.pl
Log:
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

Modified: trunk/bin/opensrf-perl.pl
===================================================================
--- trunk/bin/opensrf-perl.pl	2008-09-24 03:21:43 UTC (rev 1438)
+++ trunk/bin/opensrf-perl.pl	2008-09-25 02:59:43 UTC (rev 1439)
@@ -30,6 +30,7 @@
 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 @@
     '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_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 @@
         
     --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



More information about the opensrf-commits mailing list