Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Fix Version/s: OpenVZ-legacy
-
Component/s: Containers::Userspace
-
Security Level: Public
-
Environment:Centos7
Description
>Description of problem:
When a Centos7 container has a /etc/hostname (which is optional) the container gets a non fqdn hostname set.
using vzctl-4.9.4-1.x86_64
>How reproducible:
>Steps to Reproduce:
1 vzctl create 2016051001 --ostemplate=centos-7-x86_64-minimal --layout simfs
3. vzctl start 2016051001
2. vzctl set 2016051001 --hostname=test.localdomain --save
3. vzctl exec 2016051001 hostname
test.localdomain
4. vzctl exec 2016051001 cat /etc/hostname
cat: /etc/hostname: No such file or directory
5. vzctl exec 2016051001 touch /etc/hostname
6. vzctl set 2016051001 --hostname=test.localdomain --save
7. vzctl exec 2016051001 hostname
test
8. vzctl exec 2016051001 cat /etc/hostname
test
>Actual results:
non fqdn "test"
>Expected results:
fqdn "test.localdomain"
>Host OS:
Centos 6
>Guest OS:
Centos 7
>Additional info (see https://openvz.org/Reporting_OpenVZ_problem):
I see online that some distributions expect a non fqdn in /etc/hostname
But this does not seem to be the case for Centos 7.
Also using de official tools in the container seem to show this;
# vzctl exec 2016051001 hostnamectl set-hostname test.localdomain
# vzctl exec 2016051001 hostname
test.localdomain
# vzctl exec 2016051001 cat /etc/hostname
test.localdomain
When a Centos7 container has a /etc/hostname (which is optional) the container gets a non fqdn hostname set.
using vzctl-4.9.4-1.x86_64
>How reproducible:
>Steps to Reproduce:
1 vzctl create 2016051001 --ostemplate=centos-7-x86_64-minimal --layout simfs
3. vzctl start 2016051001
2. vzctl set 2016051001 --hostname=test.localdomain --save
3. vzctl exec 2016051001 hostname
test.localdomain
4. vzctl exec 2016051001 cat /etc/hostname
cat: /etc/hostname: No such file or directory
5. vzctl exec 2016051001 touch /etc/hostname
6. vzctl set 2016051001 --hostname=test.localdomain --save
7. vzctl exec 2016051001 hostname
test
8. vzctl exec 2016051001 cat /etc/hostname
test
>Actual results:
non fqdn "test"
>Expected results:
fqdn "test.localdomain"
>Host OS:
Centos 6
>Guest OS:
Centos 7
>Additional info (see https://openvz.org/Reporting_OpenVZ_problem):
I see online that some distributions expect a non fqdn in /etc/hostname
But this does not seem to be the case for Centos 7.
Also using de official tools in the container seem to show this;
# vzctl exec 2016051001 hostnamectl set-hostname test.localdomain
# vzctl exec 2016051001 hostname
test.localdomain
# vzctl exec 2016051001 cat /etc/hostname
test.localdomain