From: miker Date: Fri, 22 Jun 2007 01:54:39 +0000 (+0000) Subject: allow the OSRF_HOSTNAME env variable to specify the local hostname -- for single... X-Git-Tag: osrf_rel_2_0_1~954 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=608728e9f303d981de4ceb7e12676868455ab5fc;p=OpenSRF.git 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 --- 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;