Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jun 2019 22:52:49 -0700
From:      "Ronald F. Guilmette" <rfg@tristatelogic.com>
To:        freebsd-net@freebsd.org
Subject:   localhost woes  -- help requested
Message-ID:  <2826.1560577969@segfault.tristatelogic.com>

next in thread | raw e-mail | index | archive | help
I've recently completed a long overdue upgrade from FreeBSD 9.1 to
12.0.  And when I say "completed" that isn't 100% accurate, as there
are still a couple of remaining things I can't quite seem to make
work properly.

Both of these, perhaps coincidentally, have to do with the magic
name "localhost".

I can't for the life of me figure out what I've done wrong so I am
asking for help.

First I should probably explain where I have been already, as that
may help to shed light on the problem.

I installed and configured my new 12.0 system on a different (Intel-
based) machine at first.  Got almost everything I need installed and
working on that hardware before, as a last step, pulling the hard
drive out of that system and sticking in into the AMD-based system
which will be its final home.  Two things that definitely worked
before I swapped the hard drive to its new home were the Firefox and
Opera browsers.  (I know.  I checked.)

Once I had the drive installed on the AMD system, I had to make a
small diddle to /etc/rc.conf to enable the AMD Kernel Mode Switching
graphics driver.  But other than that, everything remained pretty
much as it was.  The only other thing I did was to tun on ipfw.
It took me awhile to get my ipfw rules all the way I want them,
but now everything is running peachey again...

... except for the browsers, and also one other thing (nmh outbound
email handling).  Now, both Firefox and Opera crash and burn, right
out of the gate, when started from the command line.  In both cases
thet do so both with entirely cryptic failure messages.

But here's the kicker... I futzed around with this awhile and found
out that if I just change the default value of the DISPLAY environment
variable from "localhost:0.0" to ":0.0" then both browsers *do* then
start up successfully from the command line.

So, um, what the bleep did I do wrong?

Here's the output of the command "getent hosts localhost":

::1               localhost
127.0.0.1         localhost  localhost.tristatelogic.com

This output also seems pretty entirely bizzare to me, because at some
point, while trying to debug this problem, I came to the theory that
perhaps it was all of this darned IPv6 stuff that was causing all of
the problems.  So I edited my local /etc/hosts file and I actually
COMMENTED OUT the line that defined an IPv6 address for localhost.
And yet, ever after I commented out the /etc/hosts line that defines
an IPv6 address for "localhost" *and* then rebooting, I am *still*
getting the above output from getent which is still showing an IPv6
address for localhost !?!?  So, I mean, what the hay??? I have zero
comptrehension of whay this might be the case, and if someone could
explain it to me, I would be eternally greatful.

Oh! And by the way, the relevant line from my /etc/nsswitch.conf
file is as follows:

hosts: files dns mdns

I had assumed that "files" meant /etc/hosts.  No?  It now appears,
maybe not, since my manual edits to that file appear to have no effect
whatsoever.

One last thing... I also have run into -another- problem that also
seems related to the resolution... or lack thereof... of the name
"localhost".  That name is also used in the default NMH configuration
file called /usr/local/etc/nmh/mts.conf wherein it is supposed to
designate what mail server the NMH mail client should try to connect
to when it needs to send outbound mail.

Well, believe me, the Postfix mail server is up and running on this
(AMD) machine, and its doing its job flawlessly.  And it is answering
to "telnet 127.0.0.1 25" just like it should.  HOWEVER, regardless of
that, when I go to send some outbound mail using the NMH mail client,
I am getting an error saying that NMH can't connect to "localhost".

I am totally unable to understand or explain that also/either.

I don't know if this NMH problem is even related to the problem with
the browsers.  They apparently are having trouble connecting to the X
server on "localhost"... but it seems like the two problems might be
related in some way, and might all have to do with some resolution
problem relating to this blasted name "localhost".

Any hints for how I can debug this mess would be appreciated.


Regards,
rfg


P.S.  I actually do know my way around DNS fairly well, but none of this
is DNS related, per se.  "localhost" is not an FQDN, and it isn't in any
DNS zone file that I am aware of.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2826.1560577969>