[OE-core] [PATCH] image.bbclass: Adding loop back for machine name in hosts file

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Mon Aug 4 15:35:45 UTC 2014


Sujith H <sujith.h-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> writes:

> If hostname is not added to /etc/hosts file then rpcinfo command fails
> when hostname is passed as argument.
> ...
> root at mx6q:~# rpcinfo -s mx6q
> rpcinfo: can't contact rpcbind: RPC: (unknown error code)

Is this really a common/valid use case?  'rpcinfo' is a debug tool and
when you want information about the local host, you can execute

# rpcinfo -s localhost

IMHO, when using network related functionality, you have to setup
networking.  This means:

- setup the hostname; using ${MACHINE} is ambiguous with more than one
  device and the string can contain chars forbidden by DNS ('_')

- setup name resolving; this can be done by ordinary DNS, (unambiguous)
  /etc/hosts, mDNS


When DNS mapping of ${MACHINE} (or better `hostname`) without working
DNS is really required, 'systemd' contains 'libnss_myhostname.so' (which
is to be registered in /etc/nsswitch) which returns '127.0.0.2' as a
fallback.


Enrico



More information about the Openembedded-core mailing list