Bug 15073 - Unable to set an alias to '' in VE /etc/hosts file
Summary: Unable to set an alias to '' in VE /etc/hosts file
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
Depends on:
Reported: 2008-03-25 10:47 MSK by Nikolay A. Fetisov
Modified: 2008-06-10 01:39 MSD (History)
1 user (show)

See Also:

Replace only first line for '' 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 все строки, начинающиеся 
на '', заменяются в функции change_hostname() 
в /etc/vz/dists/scripts/functions на 
"        localhost.localdomain localhost".

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