From owner-freebsd-net@freebsd.org Tue Jun 18 01:08:12 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF0C15C993F for ; Tue, 18 Jun 2019 01:08:12 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id B73ED8A9A1 for ; Tue, 18 Jun 2019 01:08:11 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: by segfault.tristatelogic.com (Postfix, from userid 1237) id DE1464E64B; Mon, 17 Jun 2019 18:08:09 -0700 (PDT) From: "Ronald F. Guilmette" To: freebsd-net Subject: Re: localhost woes -- help requested In-Reply-To: <20190618003925.A49A1156E40C@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6375.1560820089.1@segfault.tristatelogic.com> Date: Mon, 17 Jun 2019 18:08:09 -0700 Message-ID: <6376.1560820089@segfault.tristatelogic.com> X-Rspamd-Queue-Id: B73ED8A9A1 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of rfg@tristatelogic.com designates 69.62.255.118 as permitted sender) smtp.mailfrom=rfg@tristatelogic.com X-Spamd-Result: default: False [-5.88 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[tristatelogic.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-2.76)[ip: (-7.27), ipnet: 69.62.128.0/17(-3.63), asn: 14051(-2.86), country: US(-0.06)]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mx1.tristatelogic.com]; NEURAL_HAM_SHORT(-0.91)[-0.906,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14051, ipnet:69.62.128.0/17, country:US]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 01:08:13 -0000 In message <20190618003925.A49A1156E40C@mail.bitblocks.com>, Bakul Shah 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