Bug 15073

Summary: Unable to set an alias to '127.0.0.1' in VE /etc/hosts file
Product: Sisyphus Reporter: Nikolay A. Fetisov <naf>
Component: vzctlAssignee: Andrew Vasilyev <andy>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: andy
Version: unstable   
Hardware: all   
OS: Linux   
Attachments:
Description Flags
Replace only first line for '127.0.0.1' in /etc/hosts none

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 эту версию бы...