[Opensrf-commits] r961 - in trunk: bin src/perlmods/OpenSRF/Utils

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jun 21 21:56:38 EDT 2007


Author: miker
Date: 2007-06-21 21:54:39 -0400 (Thu, 21 Jun 2007)
New Revision: 961

Modified:
   trunk/bin/osrf_ctl.sh
   trunk/src/perlmods/OpenSRF/Utils/Config.pm
Log:
allow the OSRF_HOSTNAME env variable to specify the local hostname -- for single-box installs

Modified: trunk/bin/osrf_ctl.sh
===================================================================
--- trunk/bin/osrf_ctl.sh	2007-06-21 20:45:35 UTC (rev 960)
+++ trunk/bin/osrf_ctl.sh	2007-06-22 01:54:39 UTC (rev 961)
@@ -137,7 +137,11 @@
 }
 
 function start_c {
-	host=$(perl -MNet::Domain=hostfqdn -e 'print hostfqdn()')
+	host=$OSRF_HOSTNAME
+	if [ "_$host" == "_" ]; then
+		host=$(perl -MNet::Domain=hostfqdn -e 'print hostfqdn()');
+	fi;
+
 	do_action "start" $PID_OSRF_C "OpenSRF C (host=$host)";
 	opensrf-c $host $OPT_C_CONFIG opensrf;
 	pid=$(ps ax | grep "OpenSRF System-C" | grep -v grep | awk '{print $1}')

Modified: trunk/src/perlmods/OpenSRF/Utils/Config.pm
===================================================================
--- trunk/src/perlmods/OpenSRF/Utils/Config.pm	2007-06-21 20:45:35 UTC (rev 960)
+++ trunk/src/perlmods/OpenSRF/Utils/Config.pm	2007-06-22 01:54:39 UTC (rev 961)
@@ -327,7 +327,7 @@
 
 sub load_env {
 	my $self = shift;
-	my $host = hostfqdn();
+	my $host = $ENV{'OSRF_HOSTNAME'} || hostfqdn();
 	chomp $host;
 	$$self{env} = $self->section_pkg->new;
 	$$self{env}{hostname} = $host;



More information about the opensrf-commits mailing list