Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!TRANSARC.COM!Craig_Everhart From: Craig_Everhart@TRANSARC.COM Newsgroups: comp.soft-sys.andrew Subject: Re: problem with console, help (PL6) Message-ID: <0aoK=8z0BwwO8GbxA6@transarc.com> Date: 21 Aug 90 16:35:20 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 68 The RESOLVER_ENV and RESOLVLIB stuff are known sources of configuration errors, but I don't think that this one is there. That is, Andrew doesn't provide its own version of gethostbyname(); it uses whatever one is in the libraries linked to it. (That being said, there is usually a gethostbyname() in the resolver libraries, and you may need to set RESOLVLIB correctly if you're a site that expects the name resolver to work.) > "console: gethostbyname failed (12:54:00 PM ) > Help does a similar thing. After I type 'help' it sits for a few minutes > and then prints out: > "No 'localhost' found in host table; creating new window." > However, localhost is in my /etc/hosts as: > 127.1 localhost loopback loghost The problem could be decomposed to ask: [a] what is being passed to gethostbyname()? [b] will your gethostbyname() find something reasonable with that result? The answer to [b] depends on RESOLVLIB. Given that you refer to ``/etc/hosts'' in your message, I'll assume that the names you expect to hand to gethostbyname() are in your /etc/hosts file and that your name resolver is disabled somehow. Now, the question [a] remains: what's passed to gethostbyname()? This is usually the result of the Andrew GetHostDomainName() call, from overhead/util/lib/hname.c . This function will call the system function gethostname(), but sometimes it will append the result of the system function getdomainname() to it. (It appends the name if there are no dots in the gethostname() result (it's not fully qualified).) Since you're on a sun-4, you have the getdomainname() call, and by default GETDOMAIN_ENV is defined. If it doesn't make sense to append this value, you can disable this behavior by defining the AndrewSetup value ``ThisDomainSuffix'' to something appropriate for your system, to turn the local machine address into a fully-qualified domain name. If you really don't want anything to be appended, you can define ``ThisDomainSuffix'' as simply a dot (as in ThisDomainSuffix: . ) and nothing will be appended. Make the target ``hname.test'' in your overhead/util/lib build directory to test the behavior. This addresses the probable issues with the Console error messages, but it doesn't really get at the complaint from Help, that presumably really does pass "localhost" to gethostbyname(). Some remarks: [1] the line you quote from your /etc/hosts looks odd to me, since it names 127.1 rather than 127.0.0.1, but maybe this works fine and I'm just backward. [2] your gethostbyname() may in fact be consulting the domain system rather than /etc/hosts, so the ``...found in host table'' message may be more metaphorical than literal, and the name ``localhost'' may not resolve correctly via your local resolvers. [3] are all those spaces after the ``127.1'' text OK, rather than tabs? Hm. After looking at the atk/help/src/helpa.c source file, ``localhost'' isn't passed to gethostbyname() after all. Instead, a ``wmHost'' variable is assigned to the value of the environment value ``WMHOST'' (should there be any), or to the value returned from the straight gethostname() call (no getdomainname() stuff). If the value of the ``wmHost'' variable can't successfully be passed to gethostbyname(), help prints that error message. There are several levels of bogosity here: the error message is misleading, and the whole ``WMHOST'' protocol should have been replaced by something more generic when the support for X11 (and ``DISPLAY'') went in. But at least you should be able to use this information to make help work. Craig