*BSD News Article 46863


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!gatech!swrinde!dish.news.pipex.net!pipex!uunet!in1.uu.net!polstra!not-for-mail
From: jdp@polstra.com (John Polstra)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: SOLVED: rsh/rlogin problems in 2.0.5-RELEASE
Date: 14 Jul 1995 10:37:58 -0700
Organization: Polstra & Co., Seattle, WA
Lines: 53
Message-ID: <3u6a1m$q30@seattle.polstra.com>
NNTP-Posting-Host: seattle.polstra.com
Summary: Caused by #comments in /etc/hosts.equiv

Many people have posted accounts of long delays or hangs when trying to
use rsh or rlogin to a system running FreeBSD 2.0.5-RELEASE.  Today I
discovered the cause of the problem, at least on my system.  Once you
understand the cause, the fix is trivial.

On attempts to rsh from a SVR4 machine into the FreeBSD-2.0.5 machine, I
was observing delays of almost exactly 2.5 minutes.  Luckily, there is
also a third machine on the same ethernet, running SunOS.  That machine
has a sniffer program called "etherfind".  I ran it to observe what was
going on during the execution of rsh.  Immediately, I saw that the long
delays were related to unanswered DNS queries that were being sent by the
FreeBSD machine to the SVR4 machine (which is the name server for the
local net).

On the name server machine, I turned on debugging in the "in.named"
program.  Here are the strange queries that were coming from the FreeBSD
machine:

    req: nlookup(#localhost) id 1280 type=1
    req: nlookup(#my_very_good_friend.domain) id 1536 type=1

These queries are of course bogus, and the name server (rightly or
wrongly) did not respond to them.  On the FreeBSD side, the resolver
timed out and tried again, several times, adding up to (surprise) 2.5
minutes of delay.

A quick "grep my_very_good_friend /etc/*" took me straight to the
"/etc/hosts.equiv" file, which looked like this:

    #localhost
    #my_very_good_friend.domain

I had never touched this file, so it must be the default one that gets
installed when one installs FreeBSD 2.0.5-RELEASE.

THE SOLUTION:  Get rid of (or repair) that bogus "/etc/hosts.equiv" file.
That fixes the problem instantly.

THE MORAL:  Don't try to put comments into "/etc/hosts.equiv".  (A quick
look at "/usr/src/lib/libc/net/rcmd.c" confirms that there is no comment
processing for this file.)

A STRANGE OBSERVATION:  Strangely, I had no problems with rsh or rlogin
until today.  And I have not changed any of the relevant files, as far
as I know.  So I suspect that the failure mode for this particular
problem depends in some way on the vagaries of the particular name
server that is being used.  Even if you're not currently having
problems, you should repair your "/etc/hosts.equiv" file.

-- 
   John Polstra                                       jdp@polstra.com
   John D. Polstra & Co., Inc.                Seattle, Washington USA
   "Self-knowledge is always bad news."                 -- John Barth