Bug 15073 - Unable to set an alias to '127.0.0.1' in VE /etc/hosts file
Summary: Unable to set an alias to '127.0.0.1' in VE /etc/hosts file
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: vzctl (show other bugs)
Version: unstable
Hardware: all Linux
: P2 normal
Assignee: Andrew Vasilyev
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 10:47 MSK by Nikolay A. Fetisov
Modified: 2008-06-10 01:39 MSD (History)
1 user (show)

See Also:


Attachments
Replace only first line for '127.0.0.1' in /etc/hosts (604 bytes, patch)
2008-03-25 13:24 MSK, Nikolay A. Fetisov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay A. Fetisov 2008-03-25 10:47:45 MSK
Для 3.0.22-alt2 при запуске VE в /etc/hosts VE все строки, начинающиеся 
на '127.0.0.1', заменяются в функции change_hostname() 
в /etc/vz/dists/scripts/functions на 
"127.0.0.1        localhost.localdomain localhost".

Т.е., задать какое-либо дополнительное имя для 127.0.0.1 не представляется 
возможным.
Steps to Reproduce:
VE# echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
VE# echo "127.0.0.1 mysql.internal" >> /etc/hosts
VE# reboot
Actual Results:  
VE$ cat /etc/hosts
127.0.0.1        localhost.localdomain localhost
127.0.0.1        localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
IP.IP.IP.IP  hostname.domain hostname
VE$
Comment 1 Nikolay A. Fetisov 2008-03-25 13:24:42 MSK
Created attachment 2517 [details]
Replace only first line for '127.0.0.1' in /etc/hosts

И заодно - при found=1 строка с условием "!found && $2 == host" всё равно не
выполняется, эта проверка лишняя.
Comment 2 Dmitry V. Levin 2008-06-07 15:08:44 MSD
Спасибо, патч приложен в 3.0.22-alt3.
Comment 3 Nikolay A. Fetisov 2008-06-10 01:39:33 MSD
Спасибо. Ещё бы в M40/M41 эту версию бы...