From 608728e9f303d981de4ceb7e12676868455ab5fc Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 22 Jun 2007 01:54:39 +0000 Subject: [PATCH] allow the OSRF_HOSTNAME env variable to specify the local hostname -- for single-box installs git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@961 9efc2488-bf62-4759-914b-345cdb29e865 --- bin/osrf_ctl.sh | 6 +++++- src/perlmods/OpenSRF/Utils/Config.pm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/osrf_ctl.sh b/bin/osrf_ctl.sh index 89bb4a5..531d6df 100755 --- a/bin/osrf_ctl.sh +++ b/bin/osrf_ctl.sh @@ -137,7 +137,11 @@ function stop_perl { } 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}') diff --git a/src/perlmods/OpenSRF/Utils/Config.pm b/src/perlmods/OpenSRF/Utils/Config.pm index 8e9c398..427c28d 100755 --- a/src/perlmods/OpenSRF/Utils/Config.pm +++ b/src/perlmods/OpenSRF/Utils/Config.pm @@ -327,7 +327,7 @@ sub FILE { 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; -- 2.11.0