autopkgtest-xenlvm: installation fails if hostname is not in DNS?

Timo Juhani Lindfors timo.lindfors at
Tue Sep 13 11:36:44 UTC 2011


I backported autopkgtest to squeeze and tried installing to my home

Setting up autopkgtest (2.0.1) ...
Setting up autopkgtest-xenlvm (2.0.1) ...
sauna does not exist
invoke-rc.d: initscript adtxenlvm, action "start" failed.

This seems to occur since /usr/share/autopkgtest/xenlvm/readconfig has

if [ x"$adt_host_hostname" = x ]; then
        printf "finding host hostname, supposely our own FQDN: "
        adt_host_hostname=`hostname -f`
        printf "%s\n" "$adt_host_hostname"
ipaddr_from_hostname () {
 eval '
  if [ x"$adt_'$1'_ipaddr" = x ] && \
     [ x"$adt_'$1'_hostname" != x ]; then
   printf "%s" "finding '$1' IP address from hostname
   $adt_'$1'_hostname: "
   adt_'$1'_ipaddr=`adnshost -t a +Do +Dt +Dc - "$adt_'$1'_hostname"`
   echo "${adt_'$1'_ipaddr}"
ipaddr_from_hostname host

I can not add "sauna" to the DNS server of my ISP and I do not run local
bind anymore.

$ cat /etc/hosts       localhost       sauna

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
$ ping sauna
PING sauna ( 56(84) bytes of data.
64 bytes from sauna ( icmp_req=1 ttl=64 time=0.040 ms
--- sauna ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.040/0.040/0.040/0.000 ms
$ host sauna
Host sauna not found: 3(NXDOMAIN)
$ getent hosts sauna       sauna

Could we just replace the use of adnshost with "getent host"? It does
the lookup using gethostbyname() which will use whatever is configured
in /etc/nsswitch.conf instead of hardcoding DNS use.


More information about the autopkgtest-devel mailing list