[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: armv7 vs buster sudo complains about hostname or something

On Fri, Jul 05, 2019 at 06:15:02AM -0400, Gene Heskett wrote:
>	localhost
>	router.coyote.den	router
>    coyote.coyote.den	coyote
>	shop.coyote.den		shop
>	lathe.coyote.den	lathe
>	lappy.coyote.den	lappy
>	sheldon.coyote.den	sheldon
>	GO704.coyote.den	GO704
>	picnic.coyote.den	picnc
>	MFC.coyote.den		printer	scanner
>	vna.coyote.den		vna
> ::1		localhost ip6-localhost ip6-loopback
> ff02::1		ip6-allnodes
> ff02::2		ip6-allrouters
> #	raspberrypi

I don't know which machine this /etc/hosts is from, but see how the
last line is commented out, and has the name "raspberrypi", which
does not appear on any other line?

If "raspberrypi" is supposed to be your machine's local hostname, then
you should uncomment that line.  Or, if you prefer, add a line with
the machine's proper IPv4 LAN address plus its local hostname.

The purpose of having your local hostname in /etc/hosts (with *any*
valid address for it, even a loopback one like is so that
processes which try to look up the local hostname before DNS is
working will get a valid response, and not freak out.

Debian uses for this by default, but encourages you to
override this with a static LAN address, if your host has one.  If
you don't have a static LAN address, then the default will work.

Since you commented out the default (again, assuming this machine's
local hostname is "raspberrypi"), any process that tries to look up
your hostname in the absence of DNS will throw a fit, and I wouldn't
care to predict the exact symptoms you'll see.  Among them may be
processes dying immediately upon startup, processes hanging, processes
assuming things about your local network numbering scheme, processes
spewing error messages, and so on.

sudo does a hostname lookup because, for some reason incomprehensible to
mortal women and men, it has a "host" field on every configuration line.
It seems that the intent is you'll write one gigantic-ass sudoers file
with lines for every host on your network all mixed together, and drop
a copy in /etc on every host; then, the "host" field on each line will
tell each machine which lines to ignore.

I don't know *anyone* who does it that way, and the documentation does
not give any rationale for why sudoers has a "host" field, or what the
intended use of this field is... so that's just my guess.

So anyway, because of this "feature" that absolutely nobody uses, sudo
tries to look up your hostname, with multiple paths to failure if your
hostname is not properly defined.

Reply to: