[OPEN-ILS-DEV] A word on 'localhost' / securing Ejabberd

Mike Rylander mrylander at gmail.com
Thu Jun 21 22:10:11 EDT 2007


On 6/21/07, Scott McKellar <mck9 at swbell.net> wrote:
> 1. Would it be useful and desirable to make "localhost" work for
> opensrf.xml?

For the services written in C, localhost can work today with a small
edit to osrf_ctl.sh.  The Perl services, though, use Net::Domain to
find the fqdn of the local machine, and it's far too smart (by half,
perhaps?) to be tricked by any simple configuration change.

More to the point, though, is that the point of the "magical" lookup
(which I would love to see the C services do on their own as well,
instead of relying on a command line param (which is generated via
Net::Domain as well)) is that the settings served by the
opensrf.settings service are meant to be network aware.  Basically, in
order to make a cluster of servers easier to set up we've accepted a
certain amount of overhead:  each server in the cluster needs to have
its hostname and domain properly set.  It's a big net benefit when you
have 20+ servers, but potentially a conceptual hurdle when you're only
dealing with (and thinking in terms of) one host.

>
> 2. If so, would it be possible without jumping through too many
> hoops?
>

The most straightforward way I see to make localhost "easy" is to
allow for an overriding environment variable.  I'll consider this to
be a stop-gap solution until we merge the Perl and C configs (into the
opensrf_core.xml file), at which time we can revisit how the Perl
services decide what their hostname is, as the config module will be
changing altogether.

IOW, not too many hoops -- just had to be forced to address it directly.

> 3. If so, which source file or files would likely need to be
> changed?
>

Today, OpenSRF/trunk/src/perlmods/OpenSRF/Utils/Config.pm and
bin/osrf_ctl.sh are all that would need to change.  Looking at it ...
it's not a big change, so ... it's done, though untested.

Assuming it /does/ work, you can now supply an environment variable
called OSRF_HOSTNAME when running osrf_ctrl.sh and it will use that
value as the hostname for retrieving its settings from
opensrf.settings, thusly:

opensrf$ OSRF_HOSTNAME='localhost' /openils/bin/osrf_ctrl.sh -p
/openils/conf/bootstrap.conf -c /openils/conf/opensrf_core.xml -a
restart_all

Thanks for applying the correct pressure to push me into addressing that... :)

--miker

> Scott McKellar
> http://home.swbell.net/mck9/aargh/
>


More information about the Open-ils-dev mailing list