Date: Mon, 17 Jun 2019 18:08:09 -0700 From: "Ronald F. Guilmette" <rfg@tristatelogic.com> To: freebsd-net <freebsd-net@freebsd.org> Subject: Re: localhost woes -- help requested Message-ID: <6376.1560820089@segfault.tristatelogic.com> In-Reply-To: <20190618003925.A49A1156E40C@mail.bitblocks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20190618003925.A49A1156E40C@mail.bitblocks.com>, Bakul Shah <bakul@bitblocks.com> wrote: >> I really would like to understand why manual edits to /etc/hosts seem >> to have no effect whatosoever. That's issue/question #1. >> And more importantly, I'd really still >> like to know whey X applications cannot seem to connect to the X server >> when and if DISPLAY is set to localhost:0.0 while they have no problem >> doing so when DISPLAY is instead set to :0.0 This is issue/questuon #2. >I ran into this as well. I tried tracing getent() through >networking code in libc but this is quite a mess. And gdb >doesn't work reliably either. No doubt there are some new >switches I haven't explored. And threading. Ok, I have an answer now on question #2. I asked some people who know way more about X than I do (which is actually almost eerybody), and as a result I found out the whole story. It seems that at some point it time, somebody decided that it would be Good if the default configuation(s) of the X server would no longer talk to clients, by default, using TCP. (I can only assume that this was most probably a very wise security improvement for the X server at the time.) So anyway, the other thing I learned is that if one has a hostname... i.e. *any* kind of a hostname... in one's DISPLAY environment variable value, then X clients will all try to connect to the server using TCP. And that will fail, as it should nowadays. Apparenttly this even includes "localhost", which is sort of a special kind of a hostname. My problem was that... unbeknownst to me... I had the following line, left over from ancient times, in one of my tcsh shell startup files: setenv DISPLAY localhost:0.0 I simply removed that, quit X, logged out, and logged back in again, and then started X again, and everything was perfect after that, most probably because all of my processes (after starting X) were now inheriting a proper and modern sort of value for DISPLAY, which is to say ":0". That's all there was to it. I'm still totally in the dark about Question #1 (above) however, but that is just a matter of idle curiosity now, now that I have all of my X clients working properly. Regards, rfg
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6376.1560820089>