trying to install 6.0.15 on ubuntu 10.4. WTH!!?
Code:
# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
172.21.122.149 vm09.eao.drsk.ru
# The following lines are desirable for IPv6 capable hosts
::1 localhost.localdomain ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#127.0.0.1 localhost.localdomain localhost
Code:
# grep `hostname --fqdn` /etc/hosts
127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
Code:
# grep `hostname` /etc/hosts
127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
what else does your script looks for? it still requires "fqdn"
the solution I found: add one single character in regexp:
if perl -e "while (<>) { next if /^#|^127.0/; exit 1 if /\s+$HOSTNAME\s+/; }" /etc/hosts; then
with
if perl -e "while (<>) { next if /^#|^127.0/; exit 1 if /\s+\$HOSTNAME\s+/; }" /etc/hosts; then
to "Quote the next metacharacter" (perlre - perldoc.perl.org)
To check that I'm not wrong, I executed this command as regular ciommand from console:
Code:
$ perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+\$HOSTNAME\s+/; }" /etc/hosts
11111211111 but what about older command? lets see:
Code:
$ perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+$HOSTNAME\s+/; }" /etc/hosts
1111111111 So, the original command does not locate hostname at all, while corrected one locates exactly one occurrence. Lets do some more checks. Adding another fqdn into /etc/hosts:
Code:
$ cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
127.0.1.1 vmubuntu.eao.drsk.ru vmubuntu
172.21.122.149 vm09.eao.drsk.ru
172.21.122.149 vmubuntu.eao.drsk.ru vmubuntu
# The following lines are desirable for IPv6 capable hosts
::1 localhost.localdomain ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#127.0.0.1 localhost.localdomain localhost
WTH again:
Code:
$ perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+\$HOSTNAME\s+/; }" /etc/hosts
111111211111
$perl -e "while (<>) { print 1; next if /^#|^127.0/; print 2 if /\s+$HOSTNAME\s+/; }" /etc/hosts
111121111111 something mystical: both commands locate the hostname now!
Conclusion: the install script looks for "fqdn with address not starting with 127.0". But it is no one's business.