autopkgtest-xenlvm: installation fails if hostname is not in DNS?
Timo Juhani Lindfors
timo.lindfors at iki.fi
Tue Sep 13 11:36:44 UTC 2011
Hi,
I backported autopkgtest to squeeze and tried installing to my home
machine:
...
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"
fi
...
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}"
fi
'
}
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
127.0.0.1 localhost
127.0.1.1 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 (127.0.1.1) 56(84) bytes of data.
64 bytes from sauna (127.0.1.1): icmp_req=1 ttl=64 time=0.040 ms
^C
--- 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
127.0.1.1 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.
-Timo
More information about the autopkgtest-devel
mailing list