View Single Post
  #9 (permalink)  
Old 01-30-2012, 02:33 PM
troublemaker troublemaker is offline
Active Member
 
Posts: 41
Default

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.
__________________
Regards,
Sergei from Siberia

The word "traitor" is the antonym to the word "patriot".
Reply With Quote